Tests: Emit coreAboutToClose() before exiting

Now address sanitizer will not show false positives.

Change-Id: Ieeb4dc31697920ed1ca542f5647f4cb0b23a29ab
Task-number: QTCREATORBUG-14713
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2015-07-14 10:35:49 +02:00
parent eff1d9f21f
commit adefa318ae
4 changed files with 9 additions and 14 deletions

View File

@@ -847,7 +847,6 @@ void PluginManagerPrivate::nextDelayedInitialize()
\internal
*/
PluginManagerPrivate::PluginManagerPrivate(PluginManager *pluginManager) :
m_failedTests(0),
delayedInitializeTimer(0),
shutdownEventLoop(0),
m_profileElapsedMS(0),
@@ -1127,6 +1126,7 @@ void PluginManagerPrivate::startTests()
return;
}
int failedTests = 0;
foreach (const PluginManagerPrivate::TestSpec &testSpec, testSpecs) {
IPlugin *plugin = testSpec.pluginSpec->plugin();
if (!plugin)
@@ -1144,10 +1144,10 @@ void PluginManagerPrivate::startTests()
? generateCompleteTestPlan(plugin, testObjects)
: generateCustomTestPlan(plugin, testObjects, testSpec.testFunctionsOrObjects);
m_failedTests += executeTestPlan(testPlan);
failedTests += executeTestPlan(testPlan);
}
if (!testSpecs.isEmpty())
QTimer::singleShot(1, this, SLOT(exitWithNumberOfFailedTests()));
QTimer::singleShot(0, this, [failedTests]() { emit m_instance->testsFinished(failedTests); });
}
#endif
@@ -1270,14 +1270,6 @@ void PluginManagerPrivate::asyncShutdownFinished()
shutdownEventLoop->exit();
}
/*!
\internal
*/
void PluginManagerPrivate::exitWithNumberOfFailedTests()
{
QCoreApplication::exit(m_failedTests);
}
/*!
\internal
*/