forked from OSchip/llvm-project
[clangd][test] Provide registered targets to lit tests
Summary: We had tests in clangd (target_info.test) that got enabled only on systems that know about x86. But they were always disabled as clangd lit config never registered those targets. This patch adds those targets as `$TARGET$-registered-target` Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D77944
This commit is contained in:
parent
1747ba25b2
commit
d34a91a10f
|
@ -10,10 +10,19 @@ config.test_format = lit.formats.ShTest(not lit.llvm.llvm_config.use_lit_shell)
|
|||
config.test_source_root = config.clangd_source_dir + "/test"
|
||||
config.test_exec_root = config.clangd_binary_dir + "/test"
|
||||
|
||||
|
||||
# Used to enable tests based on the required targets. Can be queried with e.g.
|
||||
# REQUIRES: x86-registered-target
|
||||
def calculate_arch_features(arch_string):
|
||||
return [arch.lower() + '-registered-target' for arch in arch_string.split()]
|
||||
|
||||
|
||||
lit.llvm.llvm_config.feature_config([('--targets-built',
|
||||
calculate_arch_features)])
|
||||
|
||||
# Clangd-specific lit environment.
|
||||
config.substitutions.append(('%clangd-benchmark-dir',
|
||||
config.clangd_binary_dir + "/benchmarks"))
|
||||
|
||||
if config.clangd_build_xpc:
|
||||
config.available_features.add('clangd-xpc-support')
|
||||
|
||||
|
|
Loading…
Reference in New Issue