This repository has been archived by the owner on Nov 30, 2023. It is now read-only.
forked from timvandermeij/mobile-radio-tomography
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
47 lines (35 loc) · 1.36 KB
/
test.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import sys
from __init__ import __package__
from bench.Test_Run import Test_Run
from settings import Arguments
def main(argv):
arguments = Arguments("settings.json", argv)
test_run = Test_Run(arguments)
arguments.check_help()
# Clean up the logs directory so that old logs are not considered when
# checking for exception logs.
test_run.clear_logs_directory()
print("> Executing unit tests")
test_run.execute_unit_tests()
statement_coverage_report = test_run.execute_statement_coverage_report()
if statement_coverage_report is not None:
print("> Executing statement coverage")
print(statement_coverage_report)
method_coverage_report = test_run.execute_method_coverage_report()
if method_coverage_report is not None:
print("> Executing method coverage")
print(method_coverage_report)
files, commit_range = test_run.get_changed_files()
if files:
print("> Executing pylint on changed files in {}".format(commit_range))
test_run.execute_pylint(files)
print("> Cleaning up the logs directory")
log_contents = test_run.read_logs_directory()
if log_contents != "":
print("Exception logs found:")
print(log_contents)
test_run.clear_logs_directory()
if not test_run.is_passed():
exit(1)
if __name__ == "__main__":
main(sys.argv[1:])