brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 05a0f5e Raw
48 lines · python
1import lit.llvm2import lit.util3 4lit.llvm.initialize(lit_config, config)5lit.llvm.llvm_config.clang_setup()6lit.llvm.llvm_config.use_default_substitutions()7 8config.name = "Clangd"9config.suffixes = [".test"]10config.excludes = ["Inputs"]11config.test_format = lit.formats.ShTest(not lit.llvm.llvm_config.use_lit_shell)12config.test_source_root = config.clangd_source_dir + "/test"13config.test_exec_root = config.clangd_binary_dir + "/test"14 15 16# Used to enable tests based on the required targets. Can be queried with e.g.17#    REQUIRES: x86-registered-target18def calculate_arch_features(arch_string):19    return [arch.lower() + "-registered-target" for arch in arch_string.split()]20 21 22lit.llvm.llvm_config.feature_config([("--targets-built", calculate_arch_features)])23 24# Clangd-specific lit environment.25config.substitutions.append(26    ("%clangd-benchmark-dir", config.clangd_binary_dir + "/benchmarks")27)28 29if config.clangd_build_xpc:30    config.available_features.add("clangd-xpc-support")31 32if config.clangd_enable_remote:33    config.available_features.add("clangd-remote-index")34 35if config.clangd_tidy_checks:36    config.available_features.add("clangd-tidy-checks")37 38if config.have_zlib:39    config.available_features.add("zlib")40 41if lit.util.pythonize_bool(config.have_benchmarks):42    config.available_features.add("have-benchmarks")43 44# It is not realistically possible to account for all options that could45# possibly be present in system and user configuration files, so disable46# default configs for the test runs.47config.environment["CLANG_NO_DEFAULT_CONFIG"] = "1"48