summaryrefslogtreecommitdiffstats
path: root/zenmap/test/run_tests.py
blob: 486ffabe18f2bc60e7c791ee95f8e8faf08df508 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python3

import unittest

if __name__ == "__main__":
    import sys
    import glob
    import os
    if not hasattr(unittest.defaultTestLoader, "discover"):
        print("Python unittest discovery missing. Requires Python 3.0 or newer.")  # noqa
        sys.exit(0)

    os.chdir("..")
    suite = unittest.defaultTestLoader.discover(
        start_dir=glob.glob("build/lib*")[0],
        pattern="*.py"
        )
    unittest.TextTestRunner().run(suite)