diff --git a/tests/auto/testlib/selftests/expected_silent.junitxml b/tests/auto/testlib/selftests/expected_silent.junitxml
deleted file mode 100644
index 7293e301702..00000000000
--- a/tests/auto/testlib/selftests/expected_silent.junitxml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/auto/testlib/selftests/expected_silent.lightxml b/tests/auto/testlib/selftests/expected_silent.lightxml
deleted file mode 100644
index ad07180bd60..00000000000
--- a/tests/auto/testlib/selftests/expected_silent.lightxml
+++ /dev/null
@@ -1,66 +0,0 @@
-
- @INSERT_QT_VERSION_HERE@
-
- @INSERT_QT_VERSION_HERE@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/auto/testlib/selftests/expected_silent.tap b/tests/auto/testlib/selftests/expected_silent.tap
deleted file mode 100644
index 5970f4a058b..00000000000
--- a/tests/auto/testlib/selftests/expected_silent.tap
+++ /dev/null
@@ -1,42 +0,0 @@
-TAP version 13
-# tst_Silent
-ok 1 - initTestCase()
-ok 2 - pass()
-ok 3 - skip() # SKIP This test should skip
-not ok 4 - fail()
- ---
- type: QVERIFY
- message: This test should fail
- wanted: true (false)
- found: false (false)
- expected: true (false)
- actual: false (false)
- at: tst_Silent::fail() (qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp:0)
- file: qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp
- line: 0
- ...
-not ok 5 - xfail() # TODO This test should XFAIL
- ---
- at: tst_Silent::xfail() (qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp:0)
- file: qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp
- line: 0
- ...
-ok 6 - xpass() # TODO 'true' returned TRUE unexpectedly. (This test should XPASS)
-# This is a warning that should not appear in silent test output
-# This is an internal testlib warning that should not appear in silent test output
-# This is a debug message that should not appear in silent test output
-# This is a critical message that should not appear in silent test output
-# This is an info message that should not appear in silent test output
-# This is an internal testlib info message that should not appear in silent test output
-# This is a fatal error message that should still appear in silent test output
-not ok 7 - messages()
- ---
- # Received a fatal error.
- at: tst_Silent::messages() (qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp:0)
- file: qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp
- line: 0
- ...
-1..7
-# tests 7
-# pass 3
-# fail 3
diff --git a/tests/auto/testlib/selftests/expected_silent.teamcity b/tests/auto/testlib/selftests/expected_silent.teamcity
deleted file mode 100644
index a8b90b296ad..00000000000
--- a/tests/auto/testlib/selftests/expected_silent.teamcity
+++ /dev/null
@@ -1,12 +0,0 @@
-##teamcity[testSuiteStarted name='tst_Silent' flowId='tst_Silent']
-##teamcity[testStarted name='fail()' flowId='tst_Silent']
-##teamcity[testFailed name='fail()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp(0)|]' details='|'false|' returned FALSE. (This test should fail)' flowId='tst_Silent']
-##teamcity[testFinished name='fail()' flowId='tst_Silent']
-##teamcity[testStarted name='xpass()' flowId='tst_Silent']
-##teamcity[testFailed name='xpass()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp(0)|]' details='|'true|' returned TRUE unexpectedly. (This test should XPASS)' flowId='tst_Silent']
-##teamcity[testFinished name='xpass()' flowId='tst_Silent']
-##teamcity[testStarted name='messages()' flowId='tst_Silent']
-##teamcity[testFailed name='messages()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp(0)|]' details='Received a fatal error.' flowId='tst_Silent']
-##teamcity[testStdOut name='messages()' out='QFATAL: This is a fatal error message that should still appear in silent test output' flowId='tst_Silent']
-##teamcity[testFinished name='messages()' flowId='tst_Silent']
-##teamcity[testSuiteFinished name='tst_Silent' flowId='tst_Silent']
diff --git a/tests/auto/testlib/selftests/expected_silent.xml b/tests/auto/testlib/selftests/expected_silent.xml
deleted file mode 100644
index 6c3ffc3e629..00000000000
--- a/tests/auto/testlib/selftests/expected_silent.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
- @INSERT_QT_VERSION_HERE@
-
- @INSERT_QT_VERSION_HERE@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py
index 7dd9aa45761..5695f03df94 100755
--- a/tests/auto/testlib/selftests/generate_expected_output.py
+++ b/tests/auto/testlib/selftests/generate_expected_output.py
@@ -281,6 +281,15 @@ def testEnv(testname,
data.update(extraEnv[testname])
return data
+# See TestLogger::shouldIgnoreTest() in tst_selftest.cpp
+def shouldIgnoreTest(testname, format):
+ if testname == "junit" and not format == "junitxml":
+ return True
+ if testname in ["float", "silent"] and not format == "txt":
+ return True
+
+ return False
+
def generateTestData(test_path, expected_path, clean, formats):
"""Run one test and save its cleaned results.
@@ -296,18 +305,11 @@ def generateTestData(test_path, expected_path, clean, formats):
print("Warning: directory", testname, "contains no test executable")
return
- # See TestLogger::shouldIgnoreTest() in tst_selftest.cpp for these
- # single-format tests:
- if testname == 'junit':
- formats = ( 'junitxml', ) if 'junitxml' in formats else ()
- elif testname == 'float':
- formats = ( 'txt', ) if 'txt' in formats else ()
-
# Prepare environment in which to run tests:
env = testEnv(testname)
for format in formats:
- if testname == "junit" and not format == "junitxml":
+ if shouldIgnoreTest(testname, format):
continue
print(f' running {testname}/{format}')
cmd = [path, f'-{format}']