[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / mlir / examples / standalone / test / lit.cfg.py
blobe27dddd7fb0b9fac0044a3e401feccb6c2719f25
1 # -*- Python -*-
3 import os
4 import platform
5 import re
6 import subprocess
7 import tempfile
9 import lit.formats
10 import lit.util
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
41 # directories.
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]
55 tools = [
56 "mlir-opt",
57 "standalone-capi-test",
58 "standalone-opt",
59 "standalone-translate",
62 llvm_config.add_tool_substitutions(tools, tool_dirs)
64 llvm_config.with_environment(
65 "PYTHONPATH",
67 os.path.join(config.mlir_obj_dir, "python_packages", "standalone"),
69 append_path=True,