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)
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)
 
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to