Changeset 3289
- Timestamp:
- Aug 23, 2010 9:16:03 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/tests/automated/run_continuous.py
r3278 r3289 7 7 8 8 INTERVAL = 300 9 DELAY = 0 9 10 10 11 def run_scenarios(scenarios, group): … … 24 25 25 26 27 def usage(): 28 print """Periodically monitor working directory for Continuous and Nightly builds 29 30 Usage: 31 run_continuous.py [options] scenario1.xml [scenario2.xml ...] 32 33 options: 34 These are options which will be processed by run_continuous.py: 35 36 --delay MIN Delay both Continuous and Nightly builds by MIN minutes. 37 This is useful to coordinate the build with other build 38 machines. By default, Continuous build will be done right 39 after changes are detected, and Nightly build will be done 40 at 00:00 GMT. MIN is a float number. 41 42 """ 43 sys.exit(1) 44 26 45 if __name__ == "__main__": 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 "" 30 print "Usage: run_continuous.py scenario1.xml [scenario2.xml ...]" 31 print "" 32 sys.exit(1) 46 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": 47 usage() 33 48 34 49 # Splice list 35 scenarios = sys.argv[1:] 50 scenarios = [] 51 i = 1 52 while i < len(sys.argv): 53 if sys.argv[i]=="--delay": 54 i = i + 1 55 if i >= len(sys.argv): 56 print "Error: missing argument" 57 sys.exit(1) 58 DELAY = float(sys.argv[i]) * 60 59 print "Delay is set to %f minute(s)" % (DELAY / 60) 60 else: 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" 65 sys.exit(1) 66 scenario.append(scenario) 67 print "Scenario %s added" % (scenario) 68 i = i + 1 36 69 37 # Check if scenario exists 38 for scenario in scenarios: 39 if not os.path.exists(scenario): 40 print "Error: file " + scenario + " does not exist" 41 sys.exit(1) 70 if len(scenarios) < 1: 71 print "Error: scenario is required" 72 sys.exit(1) 42 73 43 74 # Current date
Note: See TracChangeset
for help on using the changeset viewer.