3 lit
.llvm
.initialize(lit_config
, config
)
4 lit
.llvm
.llvm_config
.use_clang([], [], required
=False)
5 lit
.llvm
.llvm_config
.use_default_substitutions()
8 config
.suffixes
= [".test"]
9 config
.excludes
= ["Inputs"]
10 config
.test_format
= lit
.formats
.ShTest(not lit
.llvm
.llvm_config
.use_lit_shell
)
11 config
.test_source_root
= config
.clangd_source_dir
+ "/test"
12 config
.test_exec_root
= config
.clangd_binary_dir
+ "/test"
15 # Used to enable tests based on the required targets. Can be queried with e.g.
16 # REQUIRES: x86-registered-target
17 def calculate_arch_features(arch_string
):
18 return [arch
.lower() + "-registered-target" for arch
in arch_string
.split()]
21 lit
.llvm
.llvm_config
.feature_config([("--targets-built", calculate_arch_features
)])
23 # Clangd-specific lit environment.
24 config
.substitutions
.append(
25 ("%clangd-benchmark-dir", config
.clangd_binary_dir
+ "/benchmarks")
28 if config
.clangd_build_xpc
:
29 config
.available_features
.add("clangd-xpc-support")
31 if config
.clangd_enable_remote
:
32 config
.available_features
.add("clangd-remote-index")
34 if config
.clangd_tidy_checks
:
35 config
.available_features
.add("clangd-tidy-checks")
38 config
.available_features
.add("zlib")
40 # It is not realistically possible to account for all options that could
41 # possibly be present in system and user configuration files, so disable
42 # default configs for the test runs.
43 config
.environment
["CLANG_NO_DEFAULT_CONFIG"] = "1"