Benny Prijono | cc1ada5 | 2008-06-15 19:43:43 +0000 | [diff] [blame] | 1 | # $Id$ |
Benny Prijono | 8c331df | 2008-06-13 15:32:08 +0000 | [diff] [blame] | 2 | import os |
| 3 | import sys |
| 4 | |
| 5 | # Initialize test list |
| 6 | tests = [] |
| 7 | |
| 8 | # Excluded tests (because they fail?) |
| 9 | excluded_tests = [ "svn", |
| 10 | "pyc", |
| 11 | "scripts-call/150_srtp_1_2", |
| 12 | "scripts-call/150_srtp_2_1", |
| 13 | "scripts-call/300_ice_1_1"] |
| 14 | |
Benny Prijono | cc1ada5 | 2008-06-15 19:43:43 +0000 | [diff] [blame] | 15 | # Add basic tests |
Benny Prijono | 8c331df | 2008-06-13 15:32:08 +0000 | [diff] [blame] | 16 | for f in os.listdir("scripts-run"): |
| 17 | tests.append("mod_run.py scripts-run/" + f) |
| 18 | |
Benny Prijono | cc1ada5 | 2008-06-15 19:43:43 +0000 | [diff] [blame] | 19 | # Add basic call tests |
Benny Prijono | 8c331df | 2008-06-13 15:32:08 +0000 | [diff] [blame] | 20 | for f in os.listdir("scripts-call"): |
| 21 | tests.append("mod_call.py scripts-call/" + f) |
| 22 | |
Benny Prijono | cc1ada5 | 2008-06-15 19:43:43 +0000 | [diff] [blame] | 23 | # Add presence tests |
| 24 | for f in os.listdir("scripts-pres"): |
| 25 | tests.append("mod_pres.py scripts-pres/" + f) |
| 26 | |
Benny Prijono | 8c331df | 2008-06-13 15:32:08 +0000 | [diff] [blame] | 27 | # Filter-out excluded tests |
| 28 | for pat in excluded_tests: |
| 29 | tests = [t for t in tests if t.find(pat)==-1] |
| 30 | |
| 31 | # Now run the tests |
| 32 | for t in tests: |
| 33 | cmdline = "python run.py " + t |
| 34 | print "Running " + cmdline |
| 35 | ret = os.system(cmdline + " > output.log") |
| 36 | if ret != 0: |
| 37 | print "Test " + t + " failed." |
| 38 | print "Please see 'output.log' for the test log." |
| 39 | sys.exit(1) |
| 40 | |
| 41 | print "All tests completed successfully" |