lit: Ignore dot files when scanning for tests (e.g., editor temprary files,

etc.)

llvm-svn: 95803
This commit is contained in:
Daniel Dunbar 2010-02-10 21:00:55 +00:00
parent 4254b19c9a
commit 0e4c6eb0d7

View File

@ -87,6 +87,10 @@ class FileBasedTest(object):
litConfig, localConfig): litConfig, localConfig):
source_path = testSuite.getSourcePath(path_in_suite) source_path = testSuite.getSourcePath(path_in_suite)
for filename in os.listdir(source_path): for filename in os.listdir(source_path):
# Ignore dot files.
if filename.startswith('.'):
continue
filepath = os.path.join(source_path, filename) filepath = os.path.join(source_path, filename)
if not os.path.isdir(filepath): if not os.path.isdir(filepath):
base,ext = os.path.splitext(filename) base,ext = os.path.splitext(filename)
@ -137,7 +141,8 @@ class OneCommandPerFileTest:
d not in localConfig.excludes)] d not in localConfig.excludes)]
for filename in filenames: for filename in filenames:
if (not self.pattern.match(filename) or if (filename.startswith('.') or
not self.pattern.match(filename) or
filename in localConfig.excludes): filename in localConfig.excludes):
continue continue