summaryrefslogtreecommitdiffstats
path: root/llvm/utils/lit/TestFormats.py
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-05 22:58:04 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-05 22:58:04 +0000
commit86a947dde96699755eb6bbaacf60f30a16305de2 (patch)
treeb93c4d59e7683fa4f4115d012caf3e87d9f858b6 /llvm/utils/lit/TestFormats.py
parent933c541270f77b5285ca40ea0c5bd7ce3708a914 (diff)
downloadbcm5719-llvm-86a947dde96699755eb6bbaacf60f30a16305de2.tar.gz
bcm5719-llvm-86a947dde96699755eb6bbaacf60f30a16305de2.zip
Teach lit's SyntaxCheckTest two new tricks:
- skip .svn directories - add a set of excluded filenames so we can easily skip tests llvm-svn: 86185
Diffstat (limited to 'llvm/utils/lit/TestFormats.py')
-rw-r--r--llvm/utils/lit/TestFormats.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/llvm/utils/lit/TestFormats.py b/llvm/utils/lit/TestFormats.py
index 7e638b47f4d..fcafe3cc7ae 100644
--- a/llvm/utils/lit/TestFormats.py
+++ b/llvm/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):]
OpenPOWER on IntegriCloud