Changeset 3296 for pjproject/trunk
- Timestamp:
- Aug 25, 2010 12:57:53 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/tests/automated/run_continuous.py
r3295 r3296 8 8 INTERVAL = 300 9 9 DELAY = 0 10 CMDLINE = ""11 10 12 def run_cmdline(group): 13 cmdline = CMDLINE + " --group " + group 14 return os.system(cmdline) 11 def run_scenarios(scenarios, group): 12 # Run each scenario 13 rc = 0 14 for scenario in scenarios: 15 argv = [] 16 argv.append("ccdash.py") 17 argv.append("scenario") 18 argv.append(scenario) 19 argv.append("--group") 20 argv.append(group) 21 thisrc = ccdash.main(argv) 22 if rc==0 and thisrc: 23 rc = thisrc 24 return rc 15 25 16 26 … … 19 29 20 30 Usage: 21 run_continuous.py [options] "cmdline" 22 23 where: 24 cmdline is command to be executed to perform the test. Typically, this is 25 a script that calls configure.py and run_scenario.py for each scenario to 26 be performed. See perform_test.sh.sample and perform_test.bat.sample for 27 sample scripts. Note that the cmdline will be called with added group 28 argument (e.g. --group Nightly). 31 run_continuous.py [options] scenario1.xml [scenario2.xml ...] 29 32 30 33 options: … … 44 47 usage() 45 48 46 # Check args 49 # Splice list 50 scenarios = [] 47 51 i = 1 48 52 while i < len(sys.argv): … … 55 59 print "Delay is set to %f minute(s)" % (DELAY / 60) 56 60 else: 57 if CMDLINE: 58 print "Error: cmdline already specified" 61 # Check if scenario exists 62 scenario = sys.argv[i] 63 if not os.path.exists(scenario): 64 print "Error: file " + scenario + " does not exist" 59 65 sys.exit(1) 60 CMDLINE = sys.argv[i] 66 scenarios.append(scenario) 67 print "Scenario %s added" % (scenario) 61 68 i = i + 1 62 69 63 if not CMDLINE:64 print "Error: cmdline is needed"70 if len(scenarios) < 1: 71 print "Error: scenario is required" 65 72 sys.exit(1) 66 73 … … 93 100 print "Will run %s after %f s.." % (group, DELAY) 94 101 time.sleep(DELAY) 95 rc = run_ cmdline(group)102 rc = run_scenarios(scenarios, group) 96 103 # Sleep even if something does change 97 104 print str(datetime.datetime.now()) + \
Note: See TracChangeset
for help on using the changeset viewer.