[libcxxabi] r221460 - Add support for UNSUPPORTED tag to lit

Eric Fiselier eric at efcs.ca
Thu Nov 6 07:26:21 PST 2014


Author: ericwf
Date: Thu Nov  6 09:26:20 2014
New Revision: 221460

URL: http://llvm.org/viewvc/llvm-project?rev=221460&view=rev
Log:
Add support for UNSUPPORTED tag to lit

Modified:
    libcxxabi/trunk/test/lit.cfg

Modified: libcxxabi/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/lit.cfg?rev=221460&r1=221459&r2=221460&view=diff
==============================================================================
--- libcxxabi/trunk/test/lit.cfg (original)
+++ libcxxabi/trunk/test/lit.cfg Thu Nov  6 09:26:20 2014
@@ -58,6 +58,7 @@ class LibcxxabiTestFormat(lit.formats.Fi
     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.Fi
                 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.Fi
                     "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)
 





More information about the cfe-commits mailing list