[llvm-commits] [llvm] r88838 - /llvm/trunk/utils/lit/TestFormats.py
Daniel Dunbar
daniel at zuster.org
Sat Nov 14 23:22:58 PST 2009
Author: ddunbar
Date: Sun Nov 15 01:22:58 2009
New Revision: 88838
URL: http://llvm.org/viewvc/llvm-project?rev=88838&view=rev
Log:
Remove duplicate implementation of excludes functionality, and support excluding
dirnames.
Also, add support for the 'unsupported' config property.
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=88838&r1=88837&r2=88838&view=diff
==============================================================================
--- llvm/trunk/utils/lit/TestFormats.py (original)
+++ llvm/trunk/utils/lit/TestFormats.py Sun Nov 15 01:22:58 2009
@@ -101,13 +101,12 @@
# 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 @@
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 @@
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()
More information about the llvm-commits
mailing list