Skip to content

Commit

Permalink
lit-test: collect coverage if ran with COVERAGE=1.
Browse files Browse the repository at this point in the history
whitequark committed Dec 3, 2015
1 parent 2b71cd2 commit 8e01d0b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lit-test/test/lit.cfg
Original file line number Diff line number Diff line change
@@ -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_) )

0 comments on commit 8e01d0b

Please sign in to comment.