AutoTest: Fix stopping test debug run

If the Debugger gets into a corrupted state and is not
stopable cleanly we do not get the stopped signal.
This in turn leaves the test runner in an inconsistent
state which cannot be reset except with a restart of Qt Creator.

Fixes: QTCREATORBUG-23298
Change-Id: I9d7e7cbc847f8883d2e750f4436c5ef281106d3a
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2019-12-11 15:15:01 +01:00
parent ae29b2794b
commit 62fd368473
2 changed files with 3 additions and 0 deletions

View File

@@ -627,6 +627,7 @@ void TestRunner::debugTests()
runControl, &RunControl::initiateStop);
connect(runControl, &RunControl::stopped, this, &TestRunner::onFinished);
m_finishDebugConnect = connect(runControl, &RunControl::finished, this, &TestRunner::onFinished);
ProjectExplorerPlugin::startRunControl(runControl);
if (useOutputProcessor && AutotestPlugin::settings()->popupOnStart)
AutotestPlugin::popupResultsPane();
@@ -723,6 +724,7 @@ void TestRunner::onFinished()
m_selectedTests.clear();
disconnect(m_stopDebugConnect);
disconnect(m_finishDebugConnect);
disconnect(m_targetConnect);
m_fakeFutureInterface = nullptr;
m_runMode = TestRunMode::None;

View File

@@ -108,6 +108,7 @@ private:
QMetaObject::Connection m_buildConnect;
// temporarily used when debugging
QMetaObject::Connection m_stopDebugConnect;
QMetaObject::Connection m_finishDebugConnect;
// temporarily used for handling of switching the current target
QMetaObject::Connection m_targetConnect;
};