forked from M-Labs/artiq
lit-test: collect coverage if ran with COVERAGE=1.
This commit is contained in:
parent
2b71cd2556
commit
8e01d0b9a1
|
@ -1,3 +1,5 @@
|
|||
# -*- python -*-
|
||||
|
||||
import os, subprocess
|
||||
import lit.util
|
||||
import lit.formats
|
||||
|
@ -10,7 +12,13 @@ config.suffixes = ['.py']
|
|||
|
||||
python_executable = 'python3.5'
|
||||
|
||||
harness = '{} {}'.format(python_executable, os.path.join(root, 'harness.py'))
|
||||
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'))
|
||||
|
|
Loading…
Reference in New Issue