From 62fd36847340c2eeeb3361a5d84bdfba4972f0f4 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 11 Dec 2019 15:15:01 +0100 Subject: [PATCH] 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 --- src/plugins/autotest/testrunner.cpp | 2 ++ src/plugins/autotest/testrunner.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp index 65508c69c29..65e23223368 100644 --- a/src/plugins/autotest/testrunner.cpp +++ b/src/plugins/autotest/testrunner.cpp @@ -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; diff --git a/src/plugins/autotest/testrunner.h b/src/plugins/autotest/testrunner.h index 48d9f2ecab9..4dfb744a256 100644 --- a/src/plugins/autotest/testrunner.h +++ b/src/plugins/autotest/testrunner.h @@ -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; };