blob: dc1119da7e7bcb6ba98ed7b7f8d3ff050c8c0bff [file] [log] [blame]
Benny Prijonocc1ada52008-06-15 19:43:43 +00001# $Id$
Benny Prijono8c331df2008-06-13 15:32:08 +00002import os
3import sys
4
Benny Prijonof9bd1f22008-06-16 13:04:44 +00005# Usage:
6# runall.py [test-to-resume]
7
8
Benny Prijono8c331df2008-06-13 15:32:08 +00009# Initialize test list
10tests = []
11
12# Excluded tests (because they fail?)
13excluded_tests = [ "svn",
14 "pyc",
15 "scripts-call/150_srtp_1_2",
16 "scripts-call/150_srtp_2_1",
17 "scripts-call/300_ice_1_1"]
18
Benny Prijonocc1ada52008-06-15 19:43:43 +000019# Add basic tests
Benny Prijono8c331df2008-06-13 15:32:08 +000020for f in os.listdir("scripts-run"):
21 tests.append("mod_run.py scripts-run/" + f)
22
Benny Prijonocc1ada52008-06-15 19:43:43 +000023# Add basic call tests
Benny Prijono8c331df2008-06-13 15:32:08 +000024for f in os.listdir("scripts-call"):
25 tests.append("mod_call.py scripts-call/" + f)
26
Benny Prijonocc1ada52008-06-15 19:43:43 +000027# Add presence tests
28for f in os.listdir("scripts-pres"):
29 tests.append("mod_pres.py scripts-pres/" + f)
30
Benny Prijono8c331df2008-06-13 15:32:08 +000031# Filter-out excluded tests
32for pat in excluded_tests:
33 tests = [t for t in tests if t.find(pat)==-1]
34
Benny Prijonof9bd1f22008-06-16 13:04:44 +000035# Resume test?
36resume_script=""
37if len(sys.argv) > 1:
38 if sys.argv[1][0]=='-' or sys.argv[1][0]=='/':
39 print "Usage:"
40 print " runall.py [RESUME]"
41 print "where"
42 print " RESUME is string/substring to specify where to resume tests."
43 print " If this argument is omited, tests will start from the beginning."
44 sys.exit(0)
45 resume_script=sys.argv[1]
46
47
Benny Prijono8c331df2008-06-13 15:32:08 +000048# Now run the tests
49for t in tests:
Benny Prijonof9bd1f22008-06-16 13:04:44 +000050 if resume_script!="" and t.find(resume_script)==-1:
51 print "Skipping " + t +".."
52 continue
53 resume_script=""
Benny Prijono8c331df2008-06-13 15:32:08 +000054 cmdline = "python run.py " + t
55 print "Running " + cmdline
56 ret = os.system(cmdline + " > output.log")
57 if ret != 0:
58 print "Test " + t + " failed."
59 print "Please see 'output.log' for the test log."
60 sys.exit(1)
61
62print "All tests completed successfully"