From bcc6b955648a4df808ba7ee52137f8d6997cce72 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Mon, 3 Dec 2018 09:13:57 -0800 Subject: [PATCH] Add coverage exclusions. Add subprocess coverage. --- .coveragerc | 14 ++++++++++++++ compiler/tests/30_openram_test.py | 15 ++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) 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)