diff --git a/.coveragerc b/.coveragerc index 5a8c6f66..a9eb6a64 100644 --- a/.coveragerc +++ b/.coveragerc @@ -4,6 +4,10 @@ omit = */.local/* # omit everything in /usr /usr/* + # ignore the unit tests themselves + */tests/* + # ignore the debug utilities + debug.py [paths] source = /home/gitlab-runner/builds/2fd64746/0 @@ -12,3 +16,13 @@ source = /home/gitlab-runner/builds/2fd64746/3 /home/gitlab-runner/builds/2fd64746/4 /home/gitlab-runner/builds/2fd64746/5 +[report] +exclude_lines = + pragma: no cover + def __repr__ + except Exception + raise AssertionError + raise NotImplementedError + if 0: + if __name__ == "__main__": + if not OPTS.is_unit_test \ No newline at end of file diff --git a/compiler/tests/30_openram_test.py b/compiler/tests/30_openram_test.py index 7450dfba..2561e7a2 100755 --- a/compiler/tests/30_openram_test.py +++ b/compiler/tests/30_openram_test.py @@ -42,13 +42,14 @@ class openram_test(openram_test): OPENRAM_HOME = os.path.abspath(os.environ.get("OPENRAM_HOME")) - - cmd = "python3 {0}/openram.py -n -o {1} -p {2} {3} config_20_{4}.py 2>&1 > {5}/output.log".format(OPENRAM_HOME, - out_file, - out_path, - verbosity, - OPTS.tech_name, - out_path) + # Always perform code coverage + exe_name = "coverage run -p {0}/openram.py ".format(OPENRAM_HOME) + cmd = "{0} -n -o {1} -p {2} {3} config_20_{4}.py 2>&1 > {5}/output.log".format(exe_name, + out_file, + out_path, + verbosity, + OPTS.tech_name, + out_path) debug.info(1, cmd) os.system(cmd)