| 1 |
|
| 2 |
|
| 3 |
import unittest |
| 4 |
|
| 5 |
from os.path import dirname, basename, isfile |
| 6 |
import glob |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
class RegressTest(unittest.TestCase): |
| 11 |
pass |
| 12 |
|
| 13 |
def main(): |
| 14 |
unittest.main() |
| 15 |
|
| 16 |
if __name__ == '__main__': |
| 17 |
directory = dirname(__file__) |
| 18 |
if directory == '': |
| 19 |
directory = '.' |
| 20 |
modules = glob.glob(directory+"/*.py") |
| 21 |
__all__ = [ basename(f)[:-3] for f in modules if isfile(f)] |
| 22 |
suite = unittest.TestSuite() |
| 23 |
|
| 24 |
for module in __all__: |
| 25 |
m = __import__(module) |
| 26 |
for cl in dir(m): |
| 27 |
try: |
| 28 |
realcl = getattr(m,cl) |
| 29 |
if issubclass(realcl, unittest.TestCase): |
| 30 |
suite.addTest(realcl()) |
| 31 |
except Exception as e: |
| 32 |
pass |
| 33 |
|
| 34 |
unittest.TextTestRunner().run(suite) |