8 from lit
.llvm
import llvm_config
10 # Configuration file for the 'lit' test runner.
12 # name: The name of this test suite.
13 config
.name
= "Clang Tools"
15 # testFormat: The test format to use to interpret tests.
16 config
.test_format
= lit
.formats
.ShTest(not llvm_config
.use_lit_shell
)
18 # suffixes: A list of file extensions to treat as test files.
30 ".module-map-checker",
34 # Test-time dependencies located in directories called 'Inputs' are excluded
35 # from test suites; there won't be any lit tests within them.
36 config
.excludes
= ["Inputs"]
38 # test_source_root: The root path where tests are located.
39 config
.test_source_root
= os
.path
.dirname(__file__
)
41 # test_exec_root: The root path where tests should be run.
42 config
.test_exec_root
= os
.path
.join(config
.clang_tools_binary_dir
, "test")
44 # Tools need the same environment setup as clang (we don't need clang itself).
45 llvm_config
.use_clang(required
=False)
47 if config
.clang_tidy_staticanalyzer
:
48 config
.available_features
.add("static-analyzer")
50 python_exec
= shlex
.quote(config
.python_executable
)
51 check_clang_tidy
= os
.path
.join(
52 config
.test_source_root
, "clang-tidy", "check_clang_tidy.py"
54 config
.substitutions
.append(
55 ("%check_clang_tidy", "%s %s" % (python_exec
, check_clang_tidy
))
57 clang_tidy_diff
= os
.path
.join(
58 config
.test_source_root
, "..", "clang-tidy", "tool", "clang-tidy-diff.py"
60 config
.substitutions
.append(
61 ("%clang_tidy_diff", "%s %s" % (python_exec
, clang_tidy_diff
))
63 run_clang_tidy
= os
.path
.join(
64 config
.test_source_root
, "..", "clang-tidy", "tool", "run-clang-tidy.py"
66 config
.substitutions
.append(
67 ("%run_clang_tidy", "%s %s" % (python_exec
, run_clang_tidy
))
69 clang_tidy_headers
= os
.path
.join(
70 config
.test_source_root
, "clang-tidy", "checkers", "Inputs", "Headers"
72 config
.substitutions
.append(("%clang_tidy_headers", clang_tidy_headers
))
74 # Plugins (loadable modules)
75 if config
.has_plugins
and config
.llvm_plugin_ext
:
76 config
.available_features
.add("plugins")
78 # It is not realistically possible to account for all options that could
79 # possibly be present in system and user configuration files, so disable
80 # default configs for the test runs.
81 config
.environment
["CLANG_NO_DEFAULT_CONFIG"] = "1"