2008-06-15 19:43:43 +00:00
|
|
|
# $Id$
|
2008-06-13 15:32:08 +00:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2008-06-16 13:04:44 +00:00
|
|
|
# Usage:
|
|
|
|
# runall.py [test-to-resume]
|
|
|
|
|
|
|
|
|
2008-06-13 15:32:08 +00:00
|
|
|
# Initialize test list
|
|
|
|
tests = []
|
|
|
|
|
|
|
|
# Excluded tests (because they fail?)
|
|
|
|
excluded_tests = [ "svn",
|
|
|
|
"pyc",
|
2008-06-20 00:25:55 +00:00
|
|
|
#"scripts-call/150_srtp_1_2",
|
|
|
|
"scripts-call/150_srtp_2_1"
|
|
|
|
]
|
2008-06-13 15:32:08 +00:00
|
|
|
|
2008-06-15 19:43:43 +00:00
|
|
|
# Add basic tests
|
2008-06-13 15:32:08 +00:00
|
|
|
for f in os.listdir("scripts-run"):
|
|
|
|
tests.append("mod_run.py scripts-run/" + f)
|
|
|
|
|
2008-06-15 19:43:43 +00:00
|
|
|
# Add basic call tests
|
2008-06-13 15:32:08 +00:00
|
|
|
for f in os.listdir("scripts-call"):
|
|
|
|
tests.append("mod_call.py scripts-call/" + f)
|
|
|
|
|
2008-06-15 19:43:43 +00:00
|
|
|
# Add presence tests
|
|
|
|
for f in os.listdir("scripts-pres"):
|
|
|
|
tests.append("mod_pres.py scripts-pres/" + f)
|
|
|
|
|
2008-06-20 00:25:55 +00:00
|
|
|
# Add mod_sendto tests
|
|
|
|
for f in os.listdir("scripts-sendto"):
|
|
|
|
tests.append("mod_sendto.py scripts-sendto/" + f)
|
|
|
|
|
2008-06-13 15:32:08 +00:00
|
|
|
# Filter-out excluded tests
|
|
|
|
for pat in excluded_tests:
|
|
|
|
tests = [t for t in tests if t.find(pat)==-1]
|
|
|
|
|
2008-06-16 13:04:44 +00:00
|
|
|
# Resume test?
|
|
|
|
resume_script=""
|
|
|
|
if len(sys.argv) > 1:
|
|
|
|
if sys.argv[1][0]=='-' or sys.argv[1][0]=='/':
|
|
|
|
print "Usage:"
|
|
|
|
print " runall.py [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."
|
|
|
|
sys.exit(0)
|
|
|
|
resume_script=sys.argv[1]
|
|
|
|
|
|
|
|
|
2008-06-13 15:32:08 +00:00
|
|
|
# Now run the tests
|
|
|
|
for t in tests:
|
2008-06-16 13:04:44 +00:00
|
|
|
if resume_script!="" and t.find(resume_script)==-1:
|
|
|
|
print "Skipping " + t +".."
|
|
|
|
continue
|
|
|
|
resume_script=""
|
2008-06-13 15:32:08 +00:00
|
|
|
cmdline = "python run.py " + t
|
|
|
|
print "Running " + cmdline
|
|
|
|
ret = os.system(cmdline + " > output.log")
|
|
|
|
if ret != 0:
|
|
|
|
print "Test " + t + " failed."
|
|
|
|
print "Please see 'output.log' for the test log."
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
print "All tests completed successfully"
|