2015-12-03 16:24:37 +08:00
|
|
|
# -*- python -*-
|
|
|
|
|
2015-07-27 08:52:45 +08:00
|
|
|
import os, subprocess
|
2015-06-06 21:58:23 +08:00
|
|
|
import lit.util
|
|
|
|
import lit.formats
|
|
|
|
|
2015-07-27 08:52:45 +08:00
|
|
|
root = os.path.join(os.path.dirname(__file__), '..')
|
|
|
|
|
2015-06-06 21:58:23 +08:00
|
|
|
config.name = 'ARTIQ'
|
|
|
|
config.test_format = lit.formats.ShTest()
|
|
|
|
config.suffixes = ['.py']
|
|
|
|
|
2015-11-07 20:17:31 +08:00
|
|
|
python_executable = 'python3.5'
|
2015-07-27 10:46:43 +08:00
|
|
|
|
2015-12-03 16:24:37 +08:00
|
|
|
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) )
|
2015-07-27 09:16:04 +08:00
|
|
|
|
2015-07-27 10:46:43 +08:00
|
|
|
not_ = '{} {}'.format(python_executable, os.path.join(root, 'not.py'))
|
|
|
|
config.substitutions.append( ('%not', not_) )
|
|
|
|
|
2015-07-27 09:16:04 +08:00
|
|
|
if os.name == 'posix':
|
2015-08-31 23:59:33 +08:00
|
|
|
support_build = os.path.join(root, 'libartiq_support')
|
|
|
|
if subprocess.call(['make', '-sC', support_build]) != 0:
|
2015-07-27 09:16:04 +08:00
|
|
|
lit_config.fatal("Unable to build JIT support library")
|
|
|
|
|
2015-08-31 23:59:33 +08:00
|
|
|
support_lib = os.path.join(support_build, 'libartiq_support.so')
|
|
|
|
config.environment['LIBARTIQ_SUPPORT'] = support_lib
|
2015-07-27 09:16:04 +08:00
|
|
|
|
|
|
|
config.available_features.add('exceptions')
|