From 2c12ef2161d3f404c56bc0c191d279db21073414 Mon Sep 17 00:00:00 2001 From: Jesse Cirimelli-Low Date: Mon, 3 Dec 2018 13:24:22 -0800 Subject: [PATCH] added warning to test 30 coverage is not installed --- compiler/globals.py | 5 +++++ compiler/tests/30_openram_test.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/compiler/globals.py b/compiler/globals.py index 3f2ff9ac..112be1c1 100644 --- a/compiler/globals.py +++ b/compiler/globals.py @@ -113,6 +113,11 @@ def check_versions(): except: OPTS.datasheet_gen = 0 + try: + import coverage + OPTS.coverage = 1 + except: + OPTS.coverage = 0 def init_openram(config_file, is_unit_test=True): """Initialize the technology, paths, simulators, etc.""" diff --git a/compiler/tests/30_openram_test.py b/compiler/tests/30_openram_test.py index 2561e7a2..60dffb46 100755 --- a/compiler/tests/30_openram_test.py +++ b/compiler/tests/30_openram_test.py @@ -43,6 +43,8 @@ class openram_test(openram_test): OPENRAM_HOME = os.path.abspath(os.environ.get("OPENRAM_HOME")) # Always perform code coverage + if OPTS.coverage == 0: + debug.warning("Failed to find coverage installation. This can be installed with pip3 install 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,