Removed checking triple target for REQUIRES and EXCLUDES. I though that LIT's 
TestRunner.py check the triple target but I was mistaken. YAGNI :P

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.
@@ -89,6 +93,13 @@
                     "Test requires the following features: %s" % (
                       ', '.join(missing_required_features),))
 
+        excluded_features = [f for f in excludes
+                             if f in test.config.available_features]
+        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.
@@ -89,6 +93,13 @@
                     "Test requires the following features: %s" % (
                       ', '.join(missing_required_features),))
 
+        excluded_features = [f for f in excludes
+                             if f in test.config.available_features]
+        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