OLD | NEW |
(Empty) | |
| 1 # Taken from utils/lit/tests in the LLVM tree and hacked together to support |
| 2 # our tests. |
| 3 |
| 4 # -*- Python -*- |
| 5 |
| 6 import os |
| 7 import sys |
| 8 |
| 9 import lit.formats |
| 10 |
| 11 # name: The name of this test suite. |
| 12 config.name = 'subzero' |
| 13 |
| 14 # testFormat: The test format to use to interpret tests. |
| 15 config.test_format = lit.formats.ShTest() |
| 16 |
| 17 # suffixes: A list of file extensions to treat as test files. |
| 18 config.suffixes = ['.ll'] |
| 19 |
| 20 # test_source_root: The root path where tests are located. |
| 21 config.test_source_root = os.path.dirname(__file__) |
| 22 config.test_exec_root = config.test_source_root |
| 23 config.target_triple = '(unused)' |
| 24 |
| 25 src_root = os.path.abspath(os.path.join(config.test_source_root, '..')) |
| 26 bin_root = src_root |
| 27 config.substitutions.append(('%{src_root}', src_root)) |
| 28 config.substitutions.append(('%{python}', sys.executable)) |
| 29 |
| 30 # Finding LLVM binary tools. All tools used in the tests must be listed in |
| 31 # the llvmbintools list. |
| 32 llvmbinpath = os.path.abspath(os.environ.get('LLVM_BIN_PATH')) |
| 33 |
| 34 # Finding Subzero tools |
| 35 config.substitutions.append(('%llvm2ice', os.path.join(bin_root, 'llvm2ice'))) |
| 36 config.substitutions.append(('%szdiff', os.path.join(bin_root, 'szdiff.py'))) |
| 37 |
| 38 llvmbintools = ['FileCheck'] |
| 39 |
| 40 for tool in llvmbintools: |
| 41 config.substitutions.append((tool, os.path.join(llvmbinpath, tool))) |
| 42 |
| 43 # Add a feature to detect the Python version. |
| 44 config.available_features.add("python%d.%d" % (sys.version_info[0], |
| 45 sys.version_info[1])) |
| 46 |
| 47 # Debugging output |
| 48 def dbg(s): |
| 49 print '[DBG] %s' % s |
| 50 |
| 51 dbg('bin_root = %s' % bin_root) |
| 52 dbg('llvmbinpath = %s' % llvmbinpath) |
| 53 |
| 54 |
OLD | NEW |