From 4e8720d9bc33ec168103b26332095e4e566ba76a Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 25 Aug 2010 12:57:53 +0000 Subject: Misc (re #1110): undo accidental checkin of run_continuous.py in previous commit git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3296 74dad513-b988-da41-8d7b-12977e46ad98 --- tests/automated/run_continuous.py | 45 ++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'tests') diff --git a/tests/automated/run_continuous.py b/tests/automated/run_continuous.py index f4da9ab2..c26d8687 100755 --- a/tests/automated/run_continuous.py +++ b/tests/automated/run_continuous.py @@ -7,25 +7,28 @@ import ccdash INTERVAL = 300 DELAY = 0 -CMDLINE = "" -def run_cmdline(group): - cmdline = CMDLINE + " --group " + group - return os.system(cmdline) +def run_scenarios(scenarios, group): + # Run each scenario + rc = 0 + for scenario in scenarios: + argv = [] + argv.append("ccdash.py") + argv.append("scenario") + argv.append(scenario) + argv.append("--group") + argv.append(group) + thisrc = ccdash.main(argv) + if rc==0 and thisrc: + rc = thisrc + return rc def usage(): print """Periodically monitor working directory for Continuous and Nightly builds Usage: - run_continuous.py [options] "cmdline" - -where: - cmdline is command to be executed to perform the test. Typically, this is - a script that calls configure.py and run_scenario.py for each scenario to - be performed. See perform_test.sh.sample and perform_test.bat.sample for - sample scripts. Note that the cmdline will be called with added group - argument (e.g. --group Nightly). + run_continuous.py [options] scenario1.xml [scenario2.xml ...] options: These are options which will be processed by run_continuous.py: @@ -43,7 +46,8 @@ if __name__ == "__main__": if len(sys.argv)<=1 or sys.argv[1]=="-h" or sys.argv[1]=="--h" or sys.argv[1]=="--help" or sys.argv[1]=="/h": usage() - # Check args + # Splice list + scenarios = [] i = 1 while i < len(sys.argv): if sys.argv[i]=="--delay": @@ -54,14 +58,17 @@ if __name__ == "__main__": DELAY = float(sys.argv[i]) * 60 print "Delay is set to %f minute(s)" % (DELAY / 60) else: - if CMDLINE: - print "Error: cmdline already specified" + # Check if scenario exists + scenario = sys.argv[i] + if not os.path.exists(scenario): + print "Error: file " + scenario + " does not exist" sys.exit(1) - CMDLINE = sys.argv[i] + scenarios.append(scenario) + print "Scenario %s added" % (scenario) i = i + 1 - if not CMDLINE: - print "Error: cmdline is needed" + if len(scenarios) < 1: + print "Error: scenario is required" sys.exit(1) # Current date @@ -92,7 +99,7 @@ if __name__ == "__main__": group = "Experimental" print "Will run %s after %f s.." % (group, DELAY) time.sleep(DELAY) - rc = run_cmdline(group) + rc = run_scenarios(scenarios, group) # Sleep even if something does change print str(datetime.datetime.now()) + \ ": done running " + group + \ -- cgit v1.2.3