Commit bbf0aa27 authored by thomie's avatar thomie
Browse files

Testsuite: never pick up .T files in .run directories

And use os.walk instead of calling os.listdir many times. The testsuite
driver should be able to handle backward slashes on Windows now.
parent afa6e830
......@@ -257,7 +257,7 @@ print('Timeout is ' + str(config.timeout))
if config.rootdirs == []:
config.rootdirs = ['.']
t_files = findTFiles(config.rootdirs)
t_files = list(findTFiles(config.rootdirs))
print('Found', len(t_files), '.T files...')
......@@ -1933,19 +1933,14 @@ def cleanup():
# Return a list of all the files ending in '.T' below directories roots.
def findTFiles(roots):
# It would be better to use os.walk, but that
# gives backslashes on Windows, which trip the
# testsuite later :-(
return [filename for root in roots for filename in findTFiles_(root)]
def findTFiles_(path):
if os.path.isdir(path):
paths = [os.path.join(path, x) for x in os.listdir(path)]
return findTFiles(paths)
elif path[-2:] == '.T':
return [path]
return []
for root in roots:
for path, dirs, files in os.walk(root, topdown=True):
# Never pick up .T files in uncleaned .run directories.
dirs[:] = [dir for dir in sorted(dirs)
if not dir.endswith(testdir_suffix)]
for filename in files:
if filename.endswith('.T'):
yield os.path.join(path, filename)
# -----------------------------------------------------------------------------
# Output a test summary to the specified file object
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment