diff options
| author | jvoisin | 2012-12-13 21:58:05 +0100 |
|---|---|---|
| committer | jvoisin | 2012-12-13 21:58:05 +0100 |
| commit | e8f3ae69fc7e40fffdb8f755702eb11f86383e37 (patch) | |
| tree | 613f1c927ec528abefc4e6395e04d9ab074c82a5 /test/test.py | |
| parent | cbf8a2a65928694202e19b6bcf56ec84bcbf613c (diff) | |
Enhance the way test.py reports failed tests
Diffstat (limited to 'test/test.py')
| -rw-r--r-- | test/test.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/test/test.py b/test/test.py index f09e1c5..de6048c 100644 --- a/test/test.py +++ b/test/test.py | |||
| @@ -15,6 +15,7 @@ import tempfile | |||
| 15 | import unittest | 15 | import unittest |
| 16 | import subprocess | 16 | import subprocess |
| 17 | import sys | 17 | import sys |
| 18 | import test | ||
| 18 | 19 | ||
| 19 | VERBOSITY = 3 | 20 | VERBOSITY = 3 |
| 20 | 21 | ||
| @@ -72,14 +73,12 @@ def main(): | |||
| 72 | import clitest | 73 | import clitest |
| 73 | import libtest | 74 | import libtest |
| 74 | 75 | ||
| 75 | failed_tests = 0 | 76 | Suite = unittest.TestSuite() |
| 77 | Suite.addTests(clitest.get_tests()) | ||
| 78 | Suite.addTests(libtest.get_tests()) | ||
| 79 | |||
| 80 | unittest.TextTestRunner(verbosity=test.VERBOSITY).run(Suite) | ||
| 76 | 81 | ||
| 77 | print('Running cli related tests:\n') | ||
| 78 | failed_tests += clitest.main() | ||
| 79 | print('\nRunning library related tests:\n') | ||
| 80 | failed_tests += libtest.main() | ||
| 81 | print('\nTotal failed tests: ' + str(failed_tests)) | ||
| 82 | return failed_tests | ||
| 83 | 82 | ||
| 84 | if __name__ == '__main__': | 83 | if __name__ == '__main__': |
| 85 | sys.exit(main()) | 84 | sys.exit(main()) |
