TestOutputReader: Report results directly through a signal

Instead of using future interface. The advantage is that
signal is delivered synchronously now, in contrary to when
future interface was used - it was queued into main event
loop.

Change-Id: Ic3d521c324c56b249515713c39bd09b9a924b6d3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2023-01-16 15:47:36 +01:00
parent bc3ebef7ce
commit 51fed728e1
3 changed files with 6 additions and 6 deletions

View File

@@ -72,8 +72,6 @@ TestRunner::TestRunner()
m_cancelTimer.setSingleShot(true);
connect(&m_cancelTimer, &QTimer::timeout, this, [this] { cancelCurrent(Timeout); });
connect(&m_futureWatcher, &QFutureWatcher<TestResult>::resultReadyAt,
this, [this](int index) { emit testResultReady(m_futureWatcher.resultAt(index)); });
connect(&m_futureWatcher, &QFutureWatcher<TestResult>::finished,
this, &TestRunner::onFinished);
connect(this, &TestRunner::requestStopTestRun,
@@ -239,7 +237,7 @@ void TestRunner::scheduleNext()
QTC_ASSERT(!m_currentOutputReader, delete m_currentOutputReader);
m_currentOutputReader = m_currentConfig->createOutputReader(*m_fakeFutureInterface, m_currentProcess);
QTC_ASSERT(m_currentOutputReader, onProcessDone(); return);
connect(m_currentOutputReader, &TestOutputReader::newResult, this, &TestRunner::testResultReady);
connect(m_currentOutputReader, &TestOutputReader::newOutputLineAvailable,
TestResultsPane::instance(), &TestResultsPane::addOutputLine);
@@ -654,6 +652,7 @@ void TestRunner::debugTests()
if (useOutputProcessor) {
TestOutputReader *outputreader = config->createOutputReader(*futureInterface, nullptr);
connect(outputreader, &TestOutputReader::newResult, this, &TestRunner::testResultReady);
outputreader->setId(inferior.command.executable().toString());
connect(outputreader, &TestOutputReader::newOutputLineAvailable,
TestResultsPane::instance(), &TestResultsPane::addOutputLine);