diff options
Diffstat (limited to 'tests/auto/testlib/selftests/generate_expected_output.py')
-rwxr-xr-x | tests/auto/testlib/selftests/generate_expected_output.py | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py index aa11ca4fe7..94eb26e481 100755 --- a/tests/auto/testlib/selftests/generate_expected_output.py +++ b/tests/auto/testlib/selftests/generate_expected_output.py @@ -116,10 +116,13 @@ class Cleaner (object): raise Fail('Unable to find', command, 'in $PATH') # Are we being run from the right place ? - myNames = scriptPath.split(os.path.sep) - if not (here.split(os.path.sep)[-5:] == myNames[-6:-1] + scriptPath, myName = os.path.split(scriptPath) + hereNames, depth = scriptPath.split(os.path.sep), 5 + hereNames = hereNames[-depth:] # path components from qtbase down + assert hereNames[0] == 'qtbase', ('Script moved: please correct depth', hereNames) + if not (here.split(os.path.sep)[-depth:] == hereNames and os.path.isfile(qmake)): - raise Fail('Run', myNames[-1], 'in its directory of a completed build') + raise Fail('Run', myName, 'in its directory of a completed build') try: qtver = subprocess.check_output([qmake, '-query', 'QT_VERSION']) @@ -127,8 +130,17 @@ class Cleaner (object): raise Fail(what.strerror) qtver = qtver.strip().decode('utf-8') - scriptPath = os.path.dirname(scriptPath) # ditch leaf file-name - sentinel = os.path.sep + 'qtbase' + os.path.sep # '/qtbase/' + hereNames = tuple(hereNames) + # Add path to specific sources and to tst_*.cpp if missing (for in-source builds): + patterns += ((r'(^|[^/])\b(qtestcase.cpp)\b', r'\1qtbase/src/testlib/\2'), + # Add more special cases here, if they show up ! + (r'([[" ])\.\./(counting/tst_counting.cpp)\b', + r'\1' + os.path.sep.join(hereNames + (r'\2',))), + # The common pattern: + (r'(^|[^/])\b(tst_)?([a-z]+\d*)\.cpp\b', + r'\1' + os.path.sep.join(hereNames + (r'\3', r'\2\3.cpp')))) + + sentinel = os.path.sep + hereNames[0] + os.path.sep # '/qtbase/' # Identify the path prefix of our qtbase ancestor directory # (source, build and $PWD, when different); trim such prefixes # off all paths we see. @@ -212,7 +224,7 @@ class Scanner (object): del re def generateTestData(testname, clean, - formats = ('xml', 'txt', 'xunitxml', 'lightxml', 'teamcity'), + formats = ('xml', 'txt', 'xunitxml', 'lightxml', 'teamcity', 'tap'), extraArgs = { "commandlinedata": "fiveTablePasses fiveTablePasses:fiveTablePasses_data1 -v2", "benchlibcallgrind": "-callgrind", |