clang-tools 19.0.0git
test/lit.cfg.py
Go to the documentation of this file.
1import lit.llvm
2
3lit.llvm.initialize(lit_config, config)
4lit.llvm.llvm_config.use_clang([], [], required=False)
5lit.llvm.llvm_config.use_default_substitutions()
6
7config.name = "Clangd"
8config.suffixes = [".test"]
9config.excludes = ["Inputs"]
10config.test_format = lit.formats.ShTest(not lit.llvm.llvm_config.use_lit_shell)
11config.test_source_root = config.clangd_source_dir + "/test"
12config.test_exec_root = config.clangd_binary_dir + "/test"
13
14
15# Used to enable tests based on the required targets. Can be queried with e.g.
16# REQUIRES: x86-registered-target
17def calculate_arch_features(arch_string):
18 return [arch.lower() + "-registered-target" for arch in arch_string.split()]
19
20
21lit.llvm.llvm_config.feature_config([("--targets-built", calculate_arch_features)])
22
23# Clangd-specific lit environment.
24config.substitutions.append(
25 ("%clangd-benchmark-dir", config.clangd_binary_dir + "/benchmarks")
26)
27
28if config.clangd_build_xpc:
29 config.available_features.add("clangd-xpc-support")
30
31if config.clangd_enable_remote:
32 config.available_features.add("clangd-remote-index")
33
34if config.clangd_tidy_checks:
35 config.available_features.add("clangd-tidy-checks")
36
37if config.have_zlib:
38 config.available_features.add("zlib")
39
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.
43config.environment["CLANG_NO_DEFAULT_CONFIG"] = "1"
def calculate_arch_features(arch_string)
Definition: test/lit.cfg.py:17