summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2008-06-27 22:15:41 +0000
committerNanang Izzuddin <nanang@teluu.com>2008-06-27 22:15:41 +0000
commit5a2322b27fb5814ddd3d3c0936e502610c7db33f (patch)
treeb310922c5d6075e87f20b41bbcde66e8bbf1982a
parent4c5f320417622b3f3b05595f0dacec59fd4748fb (diff)
Updated runall.py to cleanup the 'logs' directory before test; fixed log ext name; added report num of tests performed
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2082 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip-apps/src/test-pjsua/runall.py23
1 files changed, 16 insertions, 7 deletions
diff --git a/pjsip-apps/src/test-pjsua/runall.py b/pjsip-apps/src/test-pjsua/runall.py
index b374c549..46a7f52b 100644
--- a/pjsip-apps/src/test-pjsua/runall.py
+++ b/pjsip-apps/src/test-pjsua/runall.py
@@ -60,12 +60,12 @@ if len(sys.argv) > 1:
resume_script=sys.argv[2]
if sys.argv[1]=='/h' or sys.argv[1]=='-h' or sys.argv[1]=='--help' or sys.argv[1]=='/help':
print "Usage:"
- print " runall.py [OPTIONS] [run.py OPTIONS]"
+ print " runall.py [OPTIONS] [run.py-OPTIONS]"
print "Options:"
print " --resume,-r RESUME"
- print " where"
print " RESUME is string/substring to specify where to resume tests."
print " If this argument is omited, tests will start from the beginning."
+ print " run.py-OPTIONS are applicable here"
sys.exit(0)
@@ -83,13 +83,19 @@ for a in argv:
# Init vars
-failed_cnt = 0
+fails_cnt = 0
+tests_cnt = 0
+
+# Re-create "logs" directory
+try:
+ shutil.rmtree("logs")
+except:
+ print "Warning: failed in removing directory 'logs'"
-# Create "logs" directory
try:
os.mkdir("logs")
except:
- print
+ print "Warning: failed in creating directory 'logs'"
# Now run the tests
for t in tests:
@@ -107,15 +113,18 @@ for t in tests:
print " failed!! [" + str(dur) + "s]"
logname = re.search(".*\s+(.*)", t).group(1)
logname = re.sub("[\\\/]", "_", logname)
+ logname = re.sub("\.py$", ".log", logname)
logname = "logs/" + logname
shutil.move("output.log", logname)
print "Please see '" + logname + "' for the test log."
+ fails_cnt += 1
else:
dur = int(t1 - t0)
print " ok [" + str(dur) + "s]"
+ tests_cnt += 1
if failed_cnt == 0:
- print "All tests completed successfully"
+ print "All " + str(tests_cnt) + " tests completed successfully"
else:
- print "Tests completed, with " + str(failed_cnt) + " test(s) failed"
+ print str(tests_cnt) + " tests completed, " + str(fails_cnt) + " test(s) failed"