diff options
Diffstat (limited to 'tests/runtests.py')
-rw-r--r-- | tests/runtests.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/runtests.py b/tests/runtests.py new file mode 100644 index 0000000..f3559f5 --- /dev/null +++ b/tests/runtests.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python +import glob +import os +import sys +import unittest + +SKIP_FILES = ['runtests'] + +dir = os.path.split(os.path.abspath(__file__))[0] +os.chdir(dir) + +def gettestnames(): + files = glob.glob('*.py') + names = map(lambda x: x[:-3], files) + map(names.remove, SKIP_FILES) + return names + +suite = unittest.TestSuite() +loader = unittest.TestLoader() + +for name in gettestnames(): + suite.addTest(loader.loadTestsFromName(name)) + +testRunner = unittest.TextTestRunner() +testRunner.run(suite) |