|
| 1 | +# -*- Python -*- |
| 2 | + |
| 3 | +import os |
| 4 | +import platform |
| 5 | +import re |
| 6 | +import subprocess |
| 7 | +import tempfile |
| 8 | + |
| 9 | +import lit.formats |
| 10 | +import lit.util |
| 11 | + |
| 12 | +from lit.llvm import llvm_config |
| 13 | +from lit.llvm.subst import ToolSubst |
| 14 | +from lit.llvm.subst import FindTool |
| 15 | + |
| 16 | + |
| 17 | +# name: The name of this test suite. |
| 18 | +config.name = "ORCRT" |
| 19 | + |
| 20 | +# TODO: Consolidate the logic for turning on the internal shell by default for all LLVM test suites. |
| 21 | +# See https://github.com/llvm/llvm-project/issues/106636 for more details. |
| 22 | +# |
| 23 | +# We prefer the lit internal shell which provides a better user experience on failures |
| 24 | +# unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0 env var. |
| 25 | +use_lit_shell = True |
| 26 | +lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL") |
| 27 | +if lit_shell_env: |
| 28 | + use_lit_shell = lit.util.pythonize_bool(lit_shell_env) |
| 29 | + |
| 30 | +config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell) |
| 31 | + |
| 32 | +# suffixes: A list of file extensions to treat as test files. |
| 33 | +config.suffixes = [ |
| 34 | + ".ll", |
| 35 | + ".test", |
| 36 | + ".c", |
| 37 | +] |
| 38 | +# test_source_root: The root path where tests are located. |
| 39 | +config.test_source_root = os.path.dirname(__file__) |
| 40 | + |
| 41 | +# test_exec_root: The root path where tests should be run. |
| 42 | +config.test_exec_root = os.path.join(config.orcrt_obj_root, "test") |
| 43 | +llvm_config.with_environment("PATH", os.path.join(config.orcrt_obj_root, "tools", "orc-executor"), append_path=True) |
| 44 | +config.substitutions.append(("%PATH%", config.environment["PATH"])) |
| 45 | +#config.substitutions.append(("%shlibext", config.llvm_shlib_ext)) |
| 46 | +config.substitutions.append(("%llvm_src_root", config.llvm_src_root)) |
| 47 | +#config.substitutions.append(("%host_cxx", config.host_cxx)) |
| 48 | +#config.substitutions.append(("%host_cc", config.host_cc)) |
| 49 | +if (config.llvm_rt_tools_dir): |
| 50 | + config.llvm_tools_dir = config.llvm_rt_tools_dir |
| 51 | +llvm_config.use_default_substitutions() |
| 52 | + |
| 53 | + |
| 54 | +# excludes: A list of directories to exclude from the testsuite. The 'Inputs' |
| 55 | +# subdirectories contain auxiliary inputs for various tests in their parent |
| 56 | +# directories. |
| 57 | +config.excludes = [ |
| 58 | + "lit.cfg.py", |
| 59 | + "lit.site.cfg.py.in", |
| 60 | +] |
0 commit comments