summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2014-11-06 15:26:20 +0000
committerEric Fiselier <eric@efcs.ca>2014-11-06 15:26:20 +0000
commitf3de7d86c777825086ea83027e763630fd3ee1e9 (patch)
tree8f10213291a2dbf6785ad4006ac69f1be6281a07 /test
parent0d57ac7356151330e84fa152741654d445b6d157 (diff)
Add support for UNSUPPORTED tag to lit
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@221460 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/lit.cfg13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/lit.cfg b/test/lit.cfg
index f6efacf..7963ddd 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -58,6 +58,7 @@ class LibcxxabiTestFormat(lit.formats.FileBasedTest):
def _execute(self, test, lit_config):
# Extract test metadata from the test file.
requires = []
+ unsupported = []
with open(test.getSourcePath()) as f:
for ln in f:
if 'XFAIL:' in ln:
@@ -66,7 +67,10 @@ class LibcxxabiTestFormat(lit.formats.FileBasedTest):
elif 'REQUIRES:' in ln:
items = ln[ln.index('REQUIRES:') + 9:].split(',')
requires.extend([s.strip() for s in items])
- elif not ln.startswith("//") and ln.strip():
+ elif 'UNSUPPORTED:' in ln:
+ items = ln[ln.index('UNSUPPORTED:') + 12:].split(',')
+ unsupported.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.
break
@@ -83,6 +87,13 @@ class LibcxxabiTestFormat(lit.formats.FileBasedTest):
"Test requires the following features: %s" % (
', '.join(missing_required_features),))
+ unsupported_features = [f for f in unsupported
+ if f in test.config.available_features]
+ if unsupported_features:
+ return (lit.Test.UNSUPPORTED,
+ "Test is unsupported with the following features: %s" % (
+ ', '.join(unsupported_features),))
+
# Evaluate the test.
return self._evaluate_test(test, lit_config)