Testlib/generate_expected_output.py: Pass tests as command line arguments.

Evaluate command line arguments and use directories only when empty.

Change-Id: I818ec13c686018a3f607e91174e57d8f8bbf15f7
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
This commit is contained in:
Friedemann Kleint 2014-01-17 09:28:58 +01:00 committed by The Qt Project
parent 30e677e2bb
commit f504287e80

View File

@ -85,9 +85,11 @@ def replaceInFile(file):
sys.stdout.write(line)
def subdirs():
result = []
for path in os.listdir('.'):
if os.path.isdir('./' + path):
yield path
result.append(path)
return result
def getTestForPath(path):
if isWindows:
@ -111,8 +113,11 @@ if isWindows:
print("This script does not work on Windows.")
exit()
print("Generating test results for: " + qtver + " in: " + rootPath)
for path in subdirs():
tests = sys.argv[1:]
if len(tests) == 0:
tests = subdirs()
print("Generating " + str(len(tests)) + " test results for: " + qtver + " in: " + rootPath)
for path in tests:
if os.path.isfile(getTestForPath(path)):
generateTestData(path)
else: