[PATCH] D77944: [clangd][test] Provide registered targets to lit tests
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 11 08:31:41 PDT 2020
kadircet created this revision.
kadircet added a reviewer: sammccall.
Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay, ilya-biryukov.
Herald added a project: clang.
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`
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D77944
Files:
clang-tools-extra/clangd/test/lit.cfg.py
Index: clang-tools-extra/clangd/test/lit.cfg.py
===================================================================
--- clang-tools-extra/clangd/test/lit.cfg.py
+++ clang-tools-extra/clangd/test/lit.cfg.py
@@ -10,10 +10,22 @@
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):
+ features = []
+ for arch in arch_string.split():
+ features.append(arch.lower() + '-registered-target')
+ return features
+
+
+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')
-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77944.256774.patch
Type: text/x-patch
Size: 1025 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200411/1a5d5355/attachment.bin>
More information about the cfe-commits
mailing list