TestRunner: Don't call blocking waitForStarted()

Handle failed to start case inside done() handler.

Change-Id: Id138f0ef1fc58b6e335e08d8222e99c29c06b942
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Jarek Kobus
2022-06-29 16:45:56 +02:00
parent 2d7457573b
commit 4a9fe3e709

View File

@@ -287,12 +287,6 @@ void TestRunner::scheduleNext()
qCDebug(runnerLog) << "Environment:" << m_currentProcess->environment().toStringList();
m_currentProcess->start();
if (!m_currentProcess->waitForStarted()) {
reportResult(ResultType::MessageFatal,
tr("Failed to start test for project \"%1\".").arg(m_currentConfig->displayName())
+ processInformation(m_currentProcess) + rcInfo(m_currentConfig));
onProcessDone();
}
}
void TestRunner::cancelCurrent(TestRunner::CancelReason reason)
@@ -316,6 +310,12 @@ void TestRunner::cancelCurrent(TestRunner::CancelReason reason)
void TestRunner::onProcessDone()
{
if (m_currentProcess->result() == ProcessResult::StartFailed) {
reportResult(ResultType::MessageFatal,
tr("Failed to start test for project \"%1\".").arg(m_currentConfig->displayName())
+ processInformation(m_currentProcess) + rcInfo(m_currentConfig));
}
if (m_executingTests && m_currentConfig) {
QTC_CHECK(m_fakeFutureInterface);
m_fakeFutureInterface->setProgressValue(m_fakeFutureInterface->progressValue()