[llvm-commits] [llvm] r86185 - /llvm/trunk/utils/lit/TestFormats.py

Douglas Gregor dgregor at apple.com
Thu Nov 5 14:58:04 PST 2009


Author: dgregor
Date: Thu Nov  5 16:58:04 2009
New Revision: 86185

URL: http://llvm.org/viewvc/llvm-project?rev=86185&view=rev
Log:
Teach lit's SyntaxCheckTest two new tricks:
  - skip .svn directories
  - add a set of excluded filenames so we can easily skip tests


Modified:
    llvm/trunk/utils/lit/TestFormats.py

Modified: llvm/trunk/utils/lit/TestFormats.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/TestFormats.py?rev=86185&r1=86184&r2=86185&view=diff

==============================================================================
--- llvm/trunk/utils/lit/TestFormats.py (original)
+++ llvm/trunk/utils/lit/TestFormats.py Thu Nov  5 16:58:04 2009
@@ -103,11 +103,13 @@
     # FIXME: Refactor into generic test for running some command on a directory
     # of inputs.
 
-    def __init__(self, compiler, dir, recursive, pattern, extra_cxx_args=[]):
+    def __init__(self, compiler, dir, recursive, pattern, excludes=[], 
+                 extra_cxx_args=[]):
         self.compiler = str(compiler)
         self.dir = str(dir)
         self.recursive = bool(recursive)
         self.pattern = re.compile(pattern)
+        self.excludes = list(excludes)
         self.extra_cxx_args = list(extra_cxx_args)
 
     def getTestsInDirectory(self, testSuite, path_in_suite,
@@ -116,10 +118,23 @@
             if not self.recursive:
                 subdirs[:] = []
 
+            if dirname.__contains__('.svn'):
+                continue
+                
             for filename in filenames:
                 if (not self.pattern.match(filename) or
                     filename in localConfig.excludes):
                     continue
+                
+                # Skip any files that were specifically excluded.
+                excluded = False
+                for exclude in self.excludes:
+                    if filename.__contains__(exclude):
+                      excluded = True
+                      break
+                      
+                if excluded:
+                    continue
 
                 path = os.path.join(dirname,filename)
                 suffix = path[len(self.dir):]





More information about the llvm-commits mailing list