diff --git a/lit-test/test/lit.cfg b/lit-test/test/lit.cfg index 08f024e55..21b0acc09 100644 --- a/lit-test/test/lit.cfg +++ b/lit-test/test/lit.cfg @@ -1,3 +1,5 @@ +# -*- python -*- + import os, subprocess import lit.util import lit.formats @@ -10,8 +12,14 @@ config.suffixes = ['.py'] python_executable = 'python3.5' -harness = '{} {}'.format(python_executable, os.path.join(root, 'harness.py')) -config.substitutions.append( ('%python', harness) ) +harness = os.path.join(root, 'harness.py') +if os.getenv('COVERAGE'): + harness = 'coverage run --append --source=artiq {}'.format(harness) + config.environment['COVERAGE_FILE'] = os.path.join(root, '..', '.coverage') + config.substitutions.append( ('%python', harness) ) +else: + harness = '{} {}'.format(python_executable, harness) + config.substitutions.append( ('%python', harness) ) not_ = '{} {}'.format(python_executable, os.path.join(root, 'not.py')) config.substitutions.append( ('%not', not_) )