testlib: Properly cleanup after caught exception

We were only doing half of what qCleanup was doing in the
exception case, and in an inconsistent order. There's no
reason not to just call qCleanup to align the behavior.

Change-Id: Ic4e63afb4733de5b01a79272cca8908fca3de762
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Tor Arne Vestbø 2020-01-31 19:02:08 +01:00
parent 0dc31e667f
commit facb8b7491

View File

@ -1957,13 +1957,7 @@ int QTest::qRun()
QTestResult::setCurrentTestFunction(nullptr);
}
QTestLog::stopLogging();
#if defined(Q_OS_MACOS)
IOPMAssertionRelease(macPowerSavingDisabled);
#endif
currentTestObject = nullptr;
qCleanup();
// Re-throw exception to make debugging easier
throw;