From f504287e80e55442620343227a99000d84ad603a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 17 Jan 2014 09:28:58 +0100 Subject: 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 --- tests/auto/testlib/selftests/generate_expected_output.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py index 3212bcda2e..049bd4f448 100755 --- a/tests/auto/testlib/selftests/generate_expected_output.py +++ b/tests/auto/testlib/selftests/generate_expected_output.py @@ -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: -- cgit v1.2.3