13d2e13290
Added tests for repeated skips and failures (from within void lambdas, to simulate skips and failures from within event handlers). These exhibit yet more ways to count more than one outcome for a test. The new QTest::failOnWarning() can also provoke more than one failure from a single test, and several existing selftests exhibited various ways for the Totals line's counts to add up to more than the number of actual tests run. Fixed counting so that only the first decisive incident is counted. Tests can still report later failure or skipping, but only the first is counted. Added a currentTestState in qtestlog.cpp, by which it keeps track of whether the test has resolved to a result, and clearCurrentTestState() by which other code can reset that at the end of each test. This brought to light various places where test-end clean-up was not being handled - due to failure or skipping in a *_data() method or init, or a skip in cleanup. Fixes: QTBUG-95661 Change-Id: I5d24a37a53d3db225fa602649d8aad8f5ed6c1ad Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
75 lines
4.8 KiB
Plaintext
75 lines
4.8 KiB
Plaintext
********* Start testing of tst_Warnings *********
|
|
Config: Using QtTest library
|
|
PASS : tst_Warnings::initTestCase()
|
|
QWARN : tst_Warnings::testWarnings() Warning
|
|
QWARN : tst_Warnings::testWarnings() Warning
|
|
QDEBUG : tst_Warnings::testWarnings() Debug
|
|
QDEBUG : tst_Warnings::testWarnings() Debug
|
|
QINFO : tst_Warnings::testWarnings() Info
|
|
QINFO : tst_Warnings::testWarnings() Info
|
|
QDEBUG : tst_Warnings::testWarnings() Baba
|
|
QDEBUG : tst_Warnings::testWarnings() Baba
|
|
QDEBUG : tst_Warnings::testWarnings() Bubublabla
|
|
QWARN : tst_Warnings::testWarnings() Babablabla
|
|
PASS : tst_Warnings::testWarnings()
|
|
INFO : tst_Warnings::testMissingWarnings() Did not receive message: "Warning0"
|
|
INFO : tst_Warnings::testMissingWarnings() Did not receive message: "Warning1"
|
|
FAIL! : tst_Warnings::testMissingWarnings() Not all expected messages were received
|
|
INFO : tst_Warnings::testMissingWarningsRegularExpression() Did not receive any message matching: "Warning\s\d"
|
|
FAIL! : tst_Warnings::testMissingWarningsRegularExpression() Not all expected messages were received
|
|
INFO : tst_Warnings::testMissingWarningsWithData(first row) Did not receive message: "Warning0"
|
|
INFO : tst_Warnings::testMissingWarningsWithData(first row) Did not receive message: "Warning1"
|
|
FAIL! : tst_Warnings::testMissingWarningsWithData(first row) Not all expected messages were received
|
|
INFO : tst_Warnings::testMissingWarningsWithData(second row) Did not receive message: "Warning0"
|
|
INFO : tst_Warnings::testMissingWarningsWithData(second row) Did not receive message: "Warning1"
|
|
FAIL! : tst_Warnings::testMissingWarningsWithData(second row) Not all expected messages were received
|
|
QWARN : tst_Warnings::testFailOnWarnings() Ran out of space!
|
|
FAIL! : tst_Warnings::testFailOnWarnings() Received a warning that resulted in a failure:
|
|
Ran out of cabbage!
|
|
Loc: [qtbase/tests/auto/testlib/selftests/warnings/tst_warnings.cpp(0)]
|
|
QDEBUG : tst_Warnings::testFailOnWarnings() Ran out of tortillas!
|
|
QINFO : tst_Warnings::testFailOnWarnings() Ran out of oil!
|
|
QWARN : tst_Warnings::testFailOnWarnings() nope
|
|
FAIL! : tst_Warnings::testFailOnWarnings() Received a warning that resulted in a failure:
|
|
Ran out of biscuits!
|
|
Loc: [qtbase/tests/auto/testlib/selftests/warnings/tst_warnings.cpp(0)]
|
|
FAIL! : tst_Warnings::testFailOnWarnings() Received a warning that resulted in a failure:
|
|
Running low on toothpaste!
|
|
Loc: [qtbase/tests/auto/testlib/selftests/warnings/tst_warnings.cpp(0)]
|
|
QWARN : tst_Warnings::testFailOnWarnings() Running low on flour!
|
|
QDEBUG : tst_Warnings::testFailOnWarnings() Running low on toothpaste!
|
|
QINFO : tst_Warnings::testFailOnWarnings() Running low on toothpaste!
|
|
QWARN : tst_Warnings::testFailOnWarningsCleared() Ran out of muffins!
|
|
PASS : tst_Warnings::testFailOnWarningsCleared()
|
|
FAIL! : tst_Warnings::testFailOnWarningsWithData(warning1) Received a warning that resulted in a failure:
|
|
warning1
|
|
Loc: [qtbase/tests/auto/testlib/selftests/warnings/tst_warnings.cpp(0)]
|
|
QWARN : tst_Warnings::testFailOnWarningsWithData(warning1) warning2
|
|
QWARN : tst_Warnings::testFailOnWarningsWithData(warning1) warning3
|
|
QWARN : tst_Warnings::testFailOnWarningsWithData(warning2) warning1
|
|
FAIL! : tst_Warnings::testFailOnWarningsWithData(warning2) Received a warning that resulted in a failure:
|
|
warning2
|
|
Loc: [qtbase/tests/auto/testlib/selftests/warnings/tst_warnings.cpp(0)]
|
|
QWARN : tst_Warnings::testFailOnWarningsWithData(warning2) warning3
|
|
QWARN : tst_Warnings::testFailOnWarningsWithData(warning3) warning1
|
|
QWARN : tst_Warnings::testFailOnWarningsWithData(warning3) warning2
|
|
FAIL! : tst_Warnings::testFailOnWarningsWithData(warning3) Received a warning that resulted in a failure:
|
|
warning3
|
|
Loc: [qtbase/tests/auto/testlib/selftests/warnings/tst_warnings.cpp(0)]
|
|
FAIL! : tst_Warnings::testFailOnWarningsFailInHelper() This failure message should be printed but not cause the test to abort
|
|
Loc: [qtbase/tests/auto/testlib/selftests/warnings/tst_warnings.cpp(0)]
|
|
FAIL! : tst_Warnings::testFailOnWarningsFailInHelper() Received a warning that resulted in a failure:
|
|
Ran out of cabbage!
|
|
Loc: [qtbase/tests/auto/testlib/selftests/warnings/tst_warnings.cpp(0)]
|
|
FAIL! : tst_Warnings::testFailOnWarningsFailInHelper() My cabbage! :(
|
|
Loc: [qtbase/tests/auto/testlib/selftests/warnings/tst_warnings.cpp(0)]
|
|
FAIL! : tst_Warnings::testFailOnWarningsThenSkip() Received a warning that resulted in a failure:
|
|
Ran out of cabbage!
|
|
Loc: [qtbase/tests/auto/testlib/selftests/warnings/tst_warnings.cpp(0)]
|
|
SKIP : tst_Warnings::testFailOnWarningsThenSkip() My cabbage! :(
|
|
Loc: [qtbase/tests/auto/testlib/selftests/warnings/tst_warnings.cpp(0)]
|
|
PASS : tst_Warnings::testFailOnWarningsAndIgnoreWarnings()
|
|
PASS : tst_Warnings::cleanupTestCase()
|
|
Totals: 5 passed, 10 failed, 0 skipped, 0 blacklisted, 0ms
|
|
********* Finished testing of tst_Warnings *********
|