aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-15 07:22:58 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-15 07:22:58 +0000
commit048bac35df3896d0258312e861e7e876e0cdaff9 (patch)
treeb0798fcf548975d5841fc4454b1a3d75e9e9e53c
parent052d9cb0a88a453fef8f8e1e9b749e2fc94d7f96 (diff)
downloadexternal_llvm-048bac35df3896d0258312e861e7e876e0cdaff9.zip
external_llvm-048bac35df3896d0258312e861e7e876e0cdaff9.tar.gz
external_llvm-048bac35df3896d0258312e861e7e876e0cdaff9.tar.bz2
Remove duplicate implementation of excludes functionality, and support excluding
dirnames. Also, add support for the 'unsupported' config property. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88838 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--utils/lit/TestFormats.py20
1 files changed, 6 insertions, 14 deletions
diff --git a/utils/lit/TestFormats.py b/utils/lit/TestFormats.py
index d7454e6..e1e7ab2 100644
--- a/utils/lit/TestFormats.py
+++ b/utils/lit/TestFormats.py
@@ -101,13 +101,12 @@ class SyntaxCheckTest:
# FIXME: Refactor into generic test for running some command on a directory
# of inputs.
- def __init__(self, compiler, dir, recursive, pattern, excludes=[],
+ def __init__(self, compiler, dir, recursive, pattern,
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,23 +115,13 @@ class SyntaxCheckTest:
if not self.recursive:
subdirs[:] = []
- if dirname.__contains__('.svn'):
+ if dirname == '.svn' or dirname in localConfig.excludes:
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):]
@@ -146,6 +135,9 @@ class SyntaxCheckTest:
yield test
def execute(self, test, litConfig):
+ if test.config.unsupported:
+ return (Test.UNSUPPORTED, 'Test is unsupported')
+
tmp = tempfile.NamedTemporaryFile(suffix='.cpp')
print >>tmp, '#include "%s"' % test.source_path
tmp.flush()