-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrun_all_tests.py
25 lines (22 loc) · 1.07 KB
/
run_all_tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# _ __ _ ___ _ ___ _ _
# | |/ /_ _ __ _| |_ ___ __/ __| __ _| |___ _ __ ___| _ \ |_ _ __ _(_)_ _
# | ' <| '_/ _` | _/ _ (_-<__ \/ _` | / _ \ ' \/ -_) _/ | || / _` | | ' \
# |_|\_\_| \__,_|\__\___/__/___/\__,_|_\___/_|_|_\___|_| |_|\_,_\__, |_|_||_|
# |___/
# License: BSD License ; see LICENSE
#
# Main authors: Philipp Bucher (https://github.com/philbucher)
#
# set up testing environment (before anything else)
import initialize_testing_environment
# python imports
import unittest, sys, os
if __name__ == '__main__':
verbosity = 0
if len(sys.argv) == 2: # verbosity lvl was passed
verbosity = int(sys.argv[1])
loader = unittest.TestLoader()
tests = loader.discover(os.path.dirname(__file__)) # automatically discover all tests in this directory
testRunner = unittest.runner.TextTestRunner(verbosity=verbosity)
result = testRunner.run(tests).wasSuccessful()
sys.exit(not result) # returning inverse bcs for sys.exit 1 aka true means error