qt5base-lts/tests/auto/testlib
Vladimir Belyavsky 18aa36cf87 QTest: make failOnWarning() functional on temp objects destruction
We need to be able to handle warnings that may occur when temporary
objects, that were created in a test function, are destroyed.
For example, now we miss all warnings that might be triggered from
the object destructor, if the object's deletion was delayed (e.g. via
deleteLater()). Also we miss all the warnings that were triggered on
the test's cleanup() call.

To fix this we need simply move QTestLog::clearFailOnWarnings()
from QTestResult::finishedCurrentTestData() to the later stage,
i.e. into QTestLog::clearCurrentTestState() which is actually called
in appropriate time from QTestResult::finishedCurrentTestDataCleanup().

Same for QTestLog::clearIgnoreMessages(), since they are interrelated,
so we need to clear them at the same time.

We need this change for QML tests in particularly, to be able
fail on warnings that might be triggered from Component.onDestruction()
of some temporary test object.

Pick-to: 6.6 6.5
Change-Id: I58a57691f20761619f56bd1bea3a862f2c26f569
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-22 20:15:38 +00:00
..
initmain Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
outformat Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qabstractitemmodeltester tst_QAbstractItemModelTester: fix unittest 2023-09-08 19:17:36 +03:00
qsignalspy CMake: Make qtbase tests standalone projects 2023-07-05 15:09:32 +02:00
selftests QTest: make failOnWarning() functional on temp objects destruction 2023-11-22 20:15:38 +00:00
tostring CMake: Make qtbase tests standalone projects 2023-07-05 15:09:32 +02:00
CMakeLists.txt Move the formatting of <chrono> durations to QDebug & QtTest 2023-05-06 17:54:23 +00:00