mbligh | f975133 | 2008-04-08 18:25:33 +0000 | [diff] [blame^] | 1 | #!/usr/bin/python2.4 |
| 2 | |
| 3 | import os, sys |
| 4 | import unittest |
| 5 | |
| 6 | # ensure the root is where it should be |
| 7 | root = os.path.dirname(__file__) |
| 8 | sys.path.append(root) |
| 9 | |
| 10 | |
| 11 | suites = [] |
| 12 | def lister(dummy, dirname, files): |
| 13 | loader = unittest.TestLoader() |
| 14 | for f in files: |
| 15 | if f.endswith('_unittest.py'): |
| 16 | temp = os.path.join(dirname, f).strip('.py') |
| 17 | mod = temp[1:].replace('/', '.') |
| 18 | suite = loader.loadTestsFromName(mod) |
| 19 | suites.append(suite) |
| 20 | |
| 21 | |
| 22 | if __name__ == "__main__": |
| 23 | os.path.walk(root, lister, None) |
| 24 | alltests = unittest.TestSuite(suites) |
| 25 | runner = unittest.TextTestRunner(verbosity=2) |
| 26 | runner.run(alltests) |
| 27 | #!/usr/bin/python2.4 |
| 28 | |
| 29 | import os, sys |
| 30 | import unittest |
| 31 | |
| 32 | # ensure the root is where it should be |
| 33 | root = os.path.dirname(__file__) |
| 34 | sys.path.append(root) |
| 35 | |
| 36 | |
| 37 | suites = [] |
| 38 | def lister(dummy, dirname, files): |
| 39 | loader = unittest.TestLoader() |
| 40 | for f in files: |
| 41 | if f.endswith('_unittest.py'): |
| 42 | temp = os.path.join(dirname, f).strip('.py') |
| 43 | mod = temp[1:].replace('/', '.') |
| 44 | suite = loader.loadTestsFromName(mod) |
| 45 | suites.append(suite) |
| 46 | |
| 47 | |
| 48 | if __name__ == "__main__": |
| 49 | os.path.walk(root, lister, None) |
| 50 | alltests = unittest.TestSuite(suites) |
| 51 | runner = unittest.TextTestRunner(verbosity=2) |
| 52 | runner.run(alltests) |