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)) ...@@ -257,7 +257,7 @@ print('Timeout is ' + str(config.timeout))
if config.rootdirs == []: if config.rootdirs == []:
config.rootdirs = ['.'] config.rootdirs = ['.']
t_files = findTFiles(config.rootdirs) t_files = list(findTFiles(config.rootdirs))
print('Found', len(t_files), '.T files...') print('Found', len(t_files), '.T files...')
......
...@@ -1933,19 +1933,14 @@ def cleanup(): ...@@ -1933,19 +1933,14 @@ def cleanup():
# Return a list of all the files ending in '.T' below directories roots. # Return a list of all the files ending in '.T' below directories roots.
def findTFiles(roots): def findTFiles(roots):
# It would be better to use os.walk, but that for root in roots:
# gives backslashes on Windows, which trip the for path, dirs, files in os.walk(root, topdown=True):
# testsuite later :-( # Never pick up .T files in uncleaned .run directories.
return [filename for root in roots for filename in findTFiles_(root)] dirs[:] = [dir for dir in sorted(dirs)
if not dir.endswith(testdir_suffix)]
def findTFiles_(path): for filename in files:
if os.path.isdir(path): if filename.endswith('.T'):
paths = [os.path.join(path, x) for x in os.listdir(path)] yield os.path.join(path, filename)
return findTFiles(paths)
elif path[-2:] == '.T':
return [path]
else:
return []
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Output a test summary to the specified file object # 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