Changeset 2082 for pjproject/trunk/pjsip-apps/src/test-pjsua/runall.py
- Timestamp:
- Jun 27, 2008 10:15:41 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/test-pjsua/runall.py
r2078 r2082 61 61 if sys.argv[1]=='/h' or sys.argv[1]=='-h' or sys.argv[1]=='--help' or sys.argv[1]=='/help': 62 62 print "Usage:" 63 print " runall.py [OPTIONS] [run.py 63 print " runall.py [OPTIONS] [run.py-OPTIONS]" 64 64 print "Options:" 65 65 print " --resume,-r RESUME" 66 print " where"67 66 print " RESUME is string/substring to specify where to resume tests." 68 67 print " If this argument is omited, tests will start from the beginning." 68 print " run.py-OPTIONS are applicable here" 69 69 sys.exit(0) 70 70 … … 84 84 85 85 # Init vars 86 failed_cnt = 0 86 fails_cnt = 0 87 tests_cnt = 0 87 88 88 # Create "logs" directory 89 # Re-create "logs" directory 90 try: 91 shutil.rmtree("logs") 92 except: 93 print "Warning: failed in removing directory 'logs'" 94 89 95 try: 90 96 os.mkdir("logs") 91 97 except: 92 print 98 print "Warning: failed in creating directory 'logs'" 93 99 94 100 # Now run the tests … … 108 114 logname = re.search(".*\s+(.*)", t).group(1) 109 115 logname = re.sub("[\\\/]", "_", logname) 116 logname = re.sub("\.py$", ".log", logname) 110 117 logname = "logs/" + logname 111 118 shutil.move("output.log", logname) 112 119 print "Please see '" + logname + "' for the test log." 120 fails_cnt += 1 113 121 else: 114 122 dur = int(t1 - t0) 115 123 print " ok [" + str(dur) + "s]" 124 tests_cnt += 1 116 125 117 126 if failed_cnt == 0: 118 print "All tests completed successfully"127 print "All " + str(tests_cnt) + " tests completed successfully" 119 128 else: 120 print "Tests completed, with " + str(failed_cnt) + " test(s) failed"129 print str(tests_cnt) + " tests completed, " + str(fails_cnt) + " test(s) failed" 121 130
Note: See TracChangeset
for help on using the changeset viewer.