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.
19 config
.suffixes
= ['.c', '.cpp', '.hpp', '.m', '.mm', '.cu', '.ll', '.cl', '.s',
20 '.modularize', '.module-map-checker', '.test']
22 # Test-time dependencies located in directories called 'Inputs' are excluded
23 # from test suites; there won't be any lit tests within them.
24 config
.excludes
= ['Inputs']
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
.clang_tools_binary_dir
, 'test')
32 # Tools need the same environment setup as clang (we don't need clang itself).
33 llvm_config
.use_clang(required
= False)
35 if config
.clang_tidy_staticanalyzer
:
36 config
.available_features
.add('static-analyzer')
38 python_exec
= shlex
.quote(config
.python_executable
)
39 check_clang_tidy
= os
.path
.join(
40 config
.test_source_root
, "clang-tidy", "check_clang_tidy.py")
41 config
.substitutions
.append(
43 '%s %s' % (python_exec
, check_clang_tidy
)) )
44 clang_tidy_diff
= os
.path
.join(
45 config
.test_source_root
, "..", "clang-tidy", "tool", "clang-tidy-diff.py")
46 config
.substitutions
.append(
48 '%s %s' % (python_exec
, clang_tidy_diff
)) )
49 run_clang_tidy
= os
.path
.join(
50 config
.test_source_root
, "..", "clang-tidy", "tool", "run-clang-tidy.py")
51 config
.substitutions
.append(
53 '%s %s' % (python_exec
, run_clang_tidy
)) )
54 clang_tidy_headers
= os
.path
.join(
55 config
.test_source_root
, "clang-tidy", "checkers", "Inputs", "Headers")
56 config
.substitutions
.append(
57 ("%clang_tidy_headers", clang_tidy_headers
) )
59 # Plugins (loadable modules)
60 if config
.has_plugins
and config
.llvm_plugin_ext
:
61 config
.available_features
.add('plugins')
63 # It is not realistically possible to account for all options that could
64 # possibly be present in system and user configuration files, so disable
65 # default configs for the test runs.
66 config
.environment
["CLANG_NO_DEFAULT_CONFIG"] = "1"