Changeset 3278
- Timestamp:
- Aug 18, 2010 3:18:24 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/tests/automated/run_continuous.py
r3277 r3278 6 6 import ccdash 7 7 8 GROUP = "Continuous"9 8 INTERVAL = 300 9 10 def run_scenarios(scenarios, group): 11 # Run each scenario 12 rc = 0 13 for scenario in scenarios: 14 argv = [] 15 argv.append("ccdash.py") 16 argv.append("scenario") 17 argv.append(scenario) 18 argv.append("--group") 19 argv.append(group) 20 thisrc = ccdash.main(argv) 21 if rc==0 and thisrc: 22 rc = thisrc 23 return rc 24 10 25 11 26 if __name__ == "__main__": 12 27 if len(sys.argv)<=1 or sys.argv[1]=="-h" or sys.argv[1]=="--h" or sys.argv[1]=="/h": 28 print "This will run both Continuous and Nightly tests" 29 print "" 13 30 print "Usage: run_continuous.py scenario1.xml [scenario2.xml ...]" 14 sys.exit(0) 31 print "" 32 sys.exit(1) 15 33 16 34 # Splice list … … 22 40 print "Error: file " + scenario + " does not exist" 23 41 sys.exit(1) 42 43 # Current date 44 utc = time.gmtime(None) 45 day = utc.tm_mday 24 46 25 47 # Loop foreva … … 34 56 rc = ccdash.main(argv) 35 57 36 if rc==0: 58 utc = time.gmtime(None) 59 60 if utc.tm_mday != day or rc != 0: 61 group = "" 62 if utc.tm_mday != day: 63 day = utc.tm_mday 64 group = "Nightly" 65 elif rc != 0: 66 group = "Continuous" 67 else: 68 group = "Experimental" 69 rc = run_scenarios(scenarios, group) 70 # Sleep even if something does change 71 print str(datetime.datetime.now()) + \ 72 ": done running " + group + \ 73 "tests, will check again in " + str(INTERVAL) + "s.." 74 time.sleep(INTERVAL) 75 else: 37 76 # Nothing changed 38 print str(datetime.datetime.now()) + ": No update, will check again in " + str(INTERVAL) + "s.." 77 print str(datetime.datetime.now()) + \ 78 ": No update, will check again in " + str(INTERVAL) + "s.." 39 79 time.sleep(INTERVAL) 40 continue41 80 42 # Run each scenario43 for scenario in scenarios:44 argv = []45 argv.append("ccdash.py")46 argv.append("scenario")47 argv.append(scenario)48 argv.append("--group")49 argv.append(GROUP)50 thisrc = ccdash.main(argv)51 if rc==0 and thisrc:52 rc = thisrc53 81 54 # Sleep even if something does change55 print str(datetime.datetime.now()) + ": done, will check again in " + str(INTERVAL) + "s.."56 time.sleep(INTERVAL)57
Note: See TracChangeset
for help on using the changeset viewer.