summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib/selftests/expected_expectfail.tap
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-09-07 15:30:34 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2022-01-13 19:47:22 +0100
commit13d2e13290d61fbe85c0744b6dc4115c07d4a1fa (patch)
treedef4ec6f2090046b78eb76b2fc34ea87242b97e6 /tests/auto/testlib/selftests/expected_expectfail.tap
parent95e49966889069ffafca0167d7766cbc40fda8eb (diff)
Make counts of various types of test result add up correctly
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>
Diffstat (limited to 'tests/auto/testlib/selftests/expected_expectfail.tap')
-rw-r--r--tests/auto/testlib/selftests/expected_expectfail.tap28
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/auto/testlib/selftests/expected_expectfail.tap b/tests/auto/testlib/selftests/expected_expectfail.tap
index c520bc25c0..8527acdaf1 100644
--- a/tests/auto/testlib/selftests/expected_expectfail.tap
+++ b/tests/auto/testlib/selftests/expected_expectfail.tap
@@ -145,29 +145,29 @@ ok 32 - xpassAbortXfailContinue() # TODO 'true' returned TRUE unexpectedly. ()
ok 33 - xpassContinue() # TODO 'true' returned TRUE unexpectedly. ()
# This should be reached
ok 34 - xpassContinueSkip() # TODO 'true' returned TRUE unexpectedly. ()
-ok 35 - xpassContinueSkip() # SKIP This should be reached but not increment skip-count
-ok 36 - xpassContinueXfailAbort() # TODO 'true' returned TRUE unexpectedly. ()
-not ok 37 - xpassContinueXfailAbort() # TODO This test should xfail but not add to totals
+ok 34 - xpassContinueSkip() # SKIP This should be reached but not increment skip-count
+ok 35 - xpassContinueXfailAbort() # TODO 'true' returned TRUE unexpectedly. ()
+not ok 36 - xpassContinueXfailAbort() # TODO This test should xfail but not add to totals
---
at: tst_ExpectFail::xpassContinueXfailAbort() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:0)
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
line: 0
...
-ok 37 - xpassAbortDataDrivenWithQVerify(XPass) # TODO 'true' returned TRUE unexpectedly. ()
-ok 38 - xpassAbortDataDrivenWithQVerify(Pass)
-ok 39 - xpassContinueDataDrivenWithQVerify(XPass) # TODO 'true' returned TRUE unexpectedly. ()
+ok 36 - xpassAbortDataDrivenWithQVerify(XPass) # TODO 'true' returned TRUE unexpectedly. ()
+ok 37 - xpassAbortDataDrivenWithQVerify(Pass)
+ok 38 - xpassContinueDataDrivenWithQVerify(XPass) # TODO 'true' returned TRUE unexpectedly. ()
# Test should Continue past XPASS
# Test should simply PASS
-ok 40 - xpassContinueDataDrivenWithQVerify(Pass)
-ok 41 - xpassAbortDataDrivenWithQCompare(XPass) # TODO QCOMPARE(1, 1) returned TRUE unexpectedly.
-ok 42 - xpassAbortDataDrivenWithQCompare(Pass)
-ok 43 - xpassContinueDataDrivenWithQCompare(XPass) # TODO QCOMPARE(1, 1) returned TRUE unexpectedly.
+ok 39 - xpassContinueDataDrivenWithQVerify(Pass)
+ok 40 - xpassAbortDataDrivenWithQCompare(XPass) # TODO QCOMPARE(1, 1) returned TRUE unexpectedly.
+ok 41 - xpassAbortDataDrivenWithQCompare(Pass)
+ok 42 - xpassContinueDataDrivenWithQCompare(XPass) # TODO QCOMPARE(1, 1) returned TRUE unexpectedly.
# Test should Continue past XPASS
# Test should simply PASS
-ok 44 - xpassContinueDataDrivenWithQCompare(Pass)
+ok 43 - xpassContinueDataDrivenWithQCompare(Pass)
# Totals should add up to 44: 23 passed, 17 failed, 4 skipped
-ok 45 - cleanupTestCase()
-1..45
-# tests 45
+ok 44 - cleanupTestCase()
+1..44
+# tests 44
# pass 23
# fail 17