forked from triSYCL/triSYCL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lit.cfg
74 lines (60 loc) · 2.77 KB
/
lit.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import os
import shutil
import lit.formats
# Configuration file for the 'lit' test runner.
# name: The name of this test suite.
config.name = 'triSYCL'
# testFormat: The test format to use to interpret tests.
config.test_format = lit.formats.ShTest(execute_external=False)
# suffixes: A list of file extensions to treat as test files.
config.suffixes = ['.cpp', '.cc']
### excludes: A list of individual files to exclude.
##config.excludes = ['Inputs']
# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)
config.test_exec_root = config.test_source_root
config.target_triple = '(unused)'
src_root = os.path.join(config.test_source_root, '..')
config.environment['PYTHONPATH'] = src_root
config.substitutions.append(('%{src_root}', src_root))
config.substitutions.append(('%{inputs}', os.path.join(
src_root, 'tests', 'Inputs')))
config.substitutions.append(('%{lit}', "%%{python} %s" % (
os.path.join(src_root, 'lit.py'),)))
# To use %{execute}%s in the test files to launch make with the right
# Makefile from the top test directory
config.substitutions.append(('%{execute}',
"make -f " + config.test_source_root
+ "/Makefile execute TARGET="))
# To use %{filecheck} as the FileCheck from the running system because in
# Debian FileCheck from llvm-3.6-tools is named FileCheck-3.6 for example
for version in [ "", "-7.0", "-6.0", "-5.0", "-4.0",
"-3.9", "-3.8", "-3.7", "-3.6", "-3.5", "-3.4" ]:
filecheck_name = "FileCheck" + version
# This require at least Python 3.3
if shutil.which(filecheck_name):
# Found it
break
# This will fail here if FileCheck was not found at this level
config.substitutions.append(('%{filecheck}', filecheck_name))
# Forward the FORCE_CXX environment variable to the test and so to the
# Makefile and also some OpenCL related variables
for v in [ 'FORCE_CXX', 'OpenCL_LIBPATH', 'OpenCL_INCPATH',
'CLHPP_INCPATH',
# Preserve environment for Xilinx FPGA tools
'XILINX_SDX', 'XILINX_VIVADO',
'PATH', 'LD_LIBRARY_PATH',
# Preserve variables selecting devices
'BOOST_COMPUTE_INCPATH',
'BOOST_COMPUTE_DEFAULT_DEVICE', 'BOOST_COMPUTE_DEFAULT_DEVICE_TYPE',
'BOOST_COMPUTE_DEFAULT_PLATFORM', 'BOOST_COMPUTE_DEFAULT_VENDOR',
'BOOST_COMPUTE_DEFAULT_ENFORCE' ] :
if v in os.environ:
config.environment[v] = os.environ[v]
# Forward some options as available_features:
if 'XILINX_SDX' in os.environ:
# Allow some Xilinx xocc related tests guarded by 'REQUIRES: xilinx-xocc'
# when the XILINX_SDX environment variable is se
config.available_features.add('xilinx-xocc')
# Forward
print (config.environment)