12 from lit
.llvm
import llvm_config
13 from lit
.llvm
.subst
import ToolSubst
14 from lit
.llvm
.subst
import FindTool
16 # Configuration file for the 'lit' test runner.
18 # name: The name of this test suite.
19 config
.name
= "STANDALONE"
21 config
.test_format
= lit
.formats
.ShTest(not llvm_config
.use_lit_shell
)
23 # suffixes: A list of file extensions to treat as test files.
24 config
.suffixes
= [".mlir"]
26 # test_source_root: The root path where tests are located.
27 config
.test_source_root
= os
.path
.dirname(__file__
)
29 # test_exec_root: The root path where tests should be run.
30 config
.test_exec_root
= os
.path
.join(config
.standalone_obj_root
, "test")
32 config
.substitutions
.append(("%PATH%", config
.environment
["PATH"]))
33 config
.substitutions
.append(("%shlibext", config
.llvm_shlib_ext
))
35 llvm_config
.with_system_environment(["HOME", "INCLUDE", "LIB", "TMP", "TEMP"])
37 llvm_config
.use_default_substitutions()
39 # excludes: A list of directories to exclude from the testsuite. The 'Inputs'
40 # subdirectories contain auxiliary inputs for various tests in their parent
42 config
.excludes
= ["Inputs", "Examples", "CMakeLists.txt", "README.txt", "LICENSE.txt"]
44 # test_exec_root: The root path where tests should be run.
45 config
.test_exec_root
= os
.path
.join(config
.standalone_obj_root
, "test")
46 config
.standalone_tools_dir
= os
.path
.join(config
.standalone_obj_root
, "bin")
47 config
.standalone_libs_dir
= os
.path
.join(config
.standalone_obj_root
, "lib")
49 config
.substitutions
.append(("%standalone_libs", config
.standalone_libs_dir
))
51 # Tweak the PATH to include the tools dir.
52 llvm_config
.with_environment("PATH", config
.llvm_tools_dir
, append_path
=True)
54 tool_dirs
= [config
.standalone_tools_dir
, config
.llvm_tools_dir
]
57 "standalone-capi-test",
59 "standalone-translate",
62 llvm_config
.add_tool_substitutions(tools
, tool_dirs
)
64 llvm_config
.with_environment(
67 os
.path
.join(config
.mlir_obj_dir
, "python_packages", "standalone"),