qt6-bb10/src/testlib
Edward Welbourne 13d2e13290 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>
2022-01-13 19:47:22 +01:00
..
3rdparty
doc Doc: Use find_package(Qt6 REQUIRED COMPONENTS ...) idiom 2021-12-09 22:20:04 +01:00
CMakeLists.txt testlib: Replace custom QTestCoreList with std::vector 2021-09-10 22:19:45 +02:00
configure.cmake
qabstractitemmodeltester.cpp Fix typo in QAbstractItemModelTester 2021-12-08 17:39:27 +01:00
qabstractitemmodeltester.h
qabstracttestlogger.cpp Make Skip an incident in test logging 2021-12-09 20:54:26 +01:00
qabstracttestlogger_p.h Make Skip an incident in test logging 2021-12-09 20:54:26 +01:00
qappletestlogger.cpp Make Skip an incident in test logging 2021-12-09 20:54:26 +01:00
qappletestlogger_p.h Another round of replacing 0 with nullptr 2020-10-07 23:02:47 +02:00
qasciikey.cpp Canonical pointer usage 2021-02-09 10:27:14 +08:00
qbenchmark.cpp
qbenchmark.h
qbenchmark_p.h Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE 2020-11-30 17:16:21 +01:00
qbenchmarkevent.cpp
qbenchmarkevent_p.h
qbenchmarkmeasurement.cpp
qbenchmarkmeasurement_p.h
qbenchmarkmetric.cpp
qbenchmarkmetric.h
qbenchmarkmetric_p.h
qbenchmarkperfevents.cpp
qbenchmarkperfevents_p.h
qbenchmarktimemeasurers_p.h
qbenchmarkvalgrind.cpp Properly deprecate QProcess::pid 2020-10-01 04:55:47 +02:00
qbenchmarkvalgrind_p.h Make QStringList an alias to QList<QString> 2020-09-12 23:37:15 +02:00
qcsvbenchmarklogger.cpp
qcsvbenchmarklogger_p.h
qemulationdetector_p.h Move QEMU emulation detector to QTest 2021-02-13 10:02:51 +02:00
qjunittestlogger.cpp Remove spurious class prefixes from subclass code 2021-12-09 20:54:26 +01:00
qjunittestlogger_p.h testlib: Replace custom QTestCoreList with std::vector 2021-09-10 22:19:45 +02:00
qplaintestlogger.cpp Remove spurious class prefixes from subclass code 2021-12-09 20:54:26 +01:00
qplaintestlogger_p.h
qpropertytesthelper_p.h Include qproperty.h where needed 2021-11-04 21:45:02 +01:00
qsignaldumper.cpp
qsignaldumper_p.h
qsignalspy.h QSignalSpy: Use QMetaType instead of metatype id in initArgs 2020-11-10 11:23:55 +01:00
qsignalspy.qdoc
qt_cmdline.cmake
qtaptestlogger.cpp Tidy up in QTapTestLogger::addIncident() 2021-12-09 20:54:26 +01:00
qtaptestlogger_p.h
qteamcitylogger.cpp Use QLatin1String::arg() directly 2021-12-09 20:54:26 +01:00
qteamcitylogger_p.h
qtest.h Refactor QTEST*_MAIN() implementations 2021-12-09 20:54:25 +01:00
qtest_gui.h QTest: there's no toString(QImage) 2021-07-07 15:07:55 +02:00
qtest_network.h
qtest_widgets.h
qtestaccessible.h QTestAccessible: Clear objects in EventList when deleted 2021-05-23 10:46:03 +00:00
qtestassert.h
qtestblacklist.cpp qtestblacklist: add webOS support 2021-12-21 12:13:57 +02:00
qtestblacklist_p.h
qtestcase.cpp Make counts of various types of test result add up correctly 2022-01-13 19:47:22 +01:00
qtestcase.h Replace out-of-date comment on QTRY_IMPL(), about qWaitFor() 2021-12-09 20:54:25 +01:00
qtestcase.qdoc Long live QVERIFY_THROWS_NO_EXCEPTION! 2021-11-26 18:28:50 +01:00
qtestcoreelement_p.h testlib: Replace custom QTestCoreList with std::vector 2021-09-10 22:19:45 +02:00
qtestdata.cpp
qtestdata.h QTestData: fix streaming of u8 string literals in C++20 mode 2022-01-03 12:22:53 +01:00
qtestelement.cpp testlib: Replace custom QTestCoreList with std::vector 2021-09-10 22:19:45 +02:00
qtestelement_p.h testlib: Replace custom QTestCoreList with std::vector 2021-09-10 22:19:45 +02:00
qtestelementattribute.cpp testlib: Remove unused QTestCoreElement and QTestElementAttribute types 2021-08-10 16:06:36 +00:00
qtestelementattribute_p.h testlib: Replace custom QTestCoreList with std::vector 2021-09-10 22:19:45 +02:00
qtestevent.h
qtestevent.qdoc
qtesteventloop.h QTestEventLoop: stop when the test fails 2021-08-05 01:07:41 +02:00
qtesthelpers_p.h
qtestjunitstreamer.cpp Verify returns from QXmlTestLogger's xmlQuote() and xmlCdata() 2021-11-30 12:26:08 +01:00
qtestjunitstreamer_p.h Verify returns from QXmlTestLogger's xmlQuote() and xmlCdata() 2021-11-30 12:26:08 +01:00
qtestkeyboard.h Replace QTest::qWarn() with qWarning() 2021-09-23 16:57:03 +02:00
qtestlog.cpp Make counts of various types of test result add up correctly 2022-01-13 19:47:22 +01:00
qtestlog_p.h Make counts of various types of test result add up correctly 2022-01-13 19:47:22 +01:00
qtestmouse.cpp Remove QTest::lastMouseButton 2020-11-11 09:12:35 +01:00
qtestmouse.h Implement QTest:mouseMove widget overload to send event 2021-10-30 11:46:03 +02:00
qtestresult.cpp Make counts of various types of test result add up correctly 2022-01-13 19:47:22 +01:00
qtestresult_p.h testlib: Pass on file location on failure, but don't assume we have one 2021-08-04 17:31:51 +00:00
qtestspontaneevent.h
qtestsystem.h
qtesttable.cpp
qtesttable_p.h
qtesttouch.h Refactor testlib touch functions into qtestsupport_gui and _widgets 2020-09-08 08:02:15 +02:00
qtestutil_macos.mm
qtestutil_macos_p.h
qttestglobal.h Migrate to autogenerated cpp exports 2021-06-25 19:33:12 +02:00
qxctestlogger.mm Another round of replacing 0 with nullptr 2020-10-07 23:02:47 +02:00
qxctestlogger_p.h Another round of replacing 0 with nullptr 2020-10-07 23:02:47 +02:00
qxmltestlogger.cpp Properly indent qtestlib's XML output 2021-12-17 07:03:26 +01:00
qxmltestlogger_p.h Verify returns from QXmlTestLogger's xmlQuote() and xmlCdata() 2021-11-30 12:26:08 +01:00
selfcover.cmake CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00