diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-11-05 22:58:04 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-11-05 22:58:04 +0000 |
commit | 489b83302cb2476277a841aee546da1aa4054b28 (patch) | |
tree | 311ba697352dff5dc093ba07f4a64b6efc5d3fb0 | |
parent | fbb8fa247ec13067d9ad3f0c426e2029d15222b2 (diff) | |
download | external_llvm-489b83302cb2476277a841aee546da1aa4054b28.zip external_llvm-489b83302cb2476277a841aee546da1aa4054b28.tar.gz external_llvm-489b83302cb2476277a841aee546da1aa4054b28.tar.bz2 |
Teach lit's SyntaxCheckTest two new tricks:
- skip .svn directories
- add a set of excluded filenames so we can easily skip tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86185 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | utils/lit/TestFormats.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/utils/lit/TestFormats.py b/utils/lit/TestFormats.py index 7e638b4..fcafe3c 100644 --- a/utils/lit/TestFormats.py +++ b/utils/lit/TestFormats.py @@ -103,11 +103,13 @@ class SyntaxCheckTest: # 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 @@ class SyntaxCheckTest: 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):] |