blob: 479e59801ad976d6d582bcca266e062a9c08dbe6 [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",
Nanang Izzuddinb40e2872008-06-25 15:05:21 +000015 "scripts-call/150_srtp_2_1", # SRTP optional 'cannot' call SRTP mandatory
Benny Prijono62a969c2008-06-26 13:29:29 +000016 "scripts-call/301_ice_public_b.py", # Doesn't work because OpenSER modifies SDP
Nanang Izzuddinb40e2872008-06-25 15:05:21 +000017 "scripts-media-playrec/100_resample_lf_8_11.py", # related to clock-rate 11 kHz problem
18 "scripts-media-playrec/100_resample_lf_8_22.py", # related to clock-rate 22 kHz problem
19 "scripts-media-playrec/100_resample_lf_11" # related to clock-rate 11 kHz problem
Benny Prijono7d578a72008-06-20 00:25:55 +000020 ]
Benny Prijono8c331df2008-06-13 15:32:08 +000021
Benny Prijonocc1ada52008-06-15 19:43:43 +000022# Add basic tests
Benny Prijono8c331df2008-06-13 15:32:08 +000023for f in os.listdir("scripts-run"):
24 tests.append("mod_run.py scripts-run/" + f)
25
Benny Prijonocc1ada52008-06-15 19:43:43 +000026# Add basic call tests
Benny Prijono8c331df2008-06-13 15:32:08 +000027for f in os.listdir("scripts-call"):
28 tests.append("mod_call.py scripts-call/" + f)
29
Benny Prijonocc1ada52008-06-15 19:43:43 +000030# Add presence tests
31for f in os.listdir("scripts-pres"):
32 tests.append("mod_pres.py scripts-pres/" + f)
33
Benny Prijono7d578a72008-06-20 00:25:55 +000034# Add mod_sendto tests
35for f in os.listdir("scripts-sendto"):
36 tests.append("mod_sendto.py scripts-sendto/" + f)
37
Nanang Izzuddinb40e2872008-06-25 15:05:21 +000038# Add mod_media_playrec tests
39for f in os.listdir("scripts-media-playrec"):
40 tests.append("mod_media_playrec.py scripts-media-playrec/" + f)
41
42# Add mod_pesq tests
43for f in os.listdir("scripts-pesq"):
44 tests.append("mod_pesq.py scripts-pesq/" + f)
45
Benny Prijono8c331df2008-06-13 15:32:08 +000046# Filter-out excluded tests
47for pat in excluded_tests:
48 tests = [t for t in tests if t.find(pat)==-1]
49
Benny Prijonof9bd1f22008-06-16 13:04:44 +000050# Resume test?
51resume_script=""
52if len(sys.argv) > 1:
53 if sys.argv[1][0]=='-' or sys.argv[1][0]=='/':
54 print "Usage:"
55 print " runall.py [RESUME]"
56 print "where"
57 print " RESUME is string/substring to specify where to resume tests."
58 print " If this argument is omited, tests will start from the beginning."
59 sys.exit(0)
60 resume_script=sys.argv[1]
61
62
Benny Prijono8c331df2008-06-13 15:32:08 +000063# Now run the tests
64for t in tests:
Benny Prijonof9bd1f22008-06-16 13:04:44 +000065 if resume_script!="" and t.find(resume_script)==-1:
66 print "Skipping " + t +".."
67 continue
68 resume_script=""
Benny Prijono8c331df2008-06-13 15:32:08 +000069 cmdline = "python run.py " + t
70 print "Running " + cmdline
71 ret = os.system(cmdline + " > output.log")
72 if ret != 0:
73 print "Test " + t + " failed."
74 print "Please see 'output.log' for the test log."
75 sys.exit(1)
76
77print "All tests completed successfully"