[PATCH] [libcxx] Add EXCLUDES tag to lit. It mirrors REQUIRES.
Eric Fiselier
eric at efcs.ca
Sun Aug 17 21:46:04 PDT 2014
Hi mclow.lists, danalbert,
This patch adds support for // EXCLUDES: feature. If an excluded feature is found in the list of available features then the test is marked unsupported.
I hope to use this to mark test unsupported if the fail with msan on asan. As well as tests that fail in particular standard modes.
This patch also allows parts of the target triple to be used in REQUIRES and EXCLUDES like they are in XFAIL.
http://reviews.llvm.org/D4950
Files:
test/lit.cfg
Index: test/lit.cfg
===================================================================
--- test/lit.cfg
+++ test/lit.cfg
@@ -64,6 +64,7 @@
def _execute(self, test, lit_config):
# Extract test metadata from the test file.
requires = []
+ excludes = []
with open(test.getSourcePath()) as f:
for ln in f:
if 'XFAIL:' in ln:
@@ -72,6 +73,9 @@
elif 'REQUIRES:' in ln:
items = ln[ln.index('REQUIRES:') + 9:].split(',')
requires.extend([s.strip() for s in items])
+ elif 'EXCLUDES:' in ln:
+ items = ln[ln.index('EXCLUDES:') + 9:].split(',')
+ excludes.extend([s.strip() for s in items])
elif not ln.strip().startswith("//") and ln.strip():
# Stop at the first non-empty line that is not a C++
# comment.
@@ -83,12 +87,21 @@
# introducing a dependency there. What we more ideally would like to do
# is lift the "requires" handling to be a core lit framework feature.
missing_required_features = [f for f in requires
- if f not in test.config.available_features]
+ if f not in test.config.available_features
+ and f not in test.config.target_triple]
if missing_required_features:
return (lit.Test.UNSUPPORTED,
"Test requires the following features: %s" % (
', '.join(missing_required_features),))
+ excluded_features = [f for f in excludes
+ if f in test.config.available_features
+ or f in test.config.target_triple]
+ if excluded_features:
+ return (lit.Test.UNSUPPORTED,
+ "Test excludes the following features: %s" % (
+ ', '.join(excluded_features),))
+
# Evaluate the test.
return self._evaluate_test(test, lit_config)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4950.12604.patch
Type: text/x-patch
Size: 2102 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140818/c10e8b8a/attachment.bin>
More information about the cfe-commits
mailing list