diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index cec06c16b0c..8ab67c0bc54 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -2125,17 +2125,6 @@ DebuggerPlugin::~DebuggerPlugin() m_instance = nullptr; } -bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMessage) -{ - Q_UNUSED(errorMessage) - - // Needed for call from AppOutputPane::attachToRunControl() and GammarayIntegration. - ExtensionSystem::PluginManager::addObject(this); - - dd = new DebuggerPluginPrivate(arguments); - return true; -} - IPlugin::ShutdownFlag DebuggerPlugin::aboutToShutdown() { ExtensionSystem::PluginManager::removeObject(this); @@ -2489,20 +2478,24 @@ void DebuggerUnitTests::testDebuggerMatching() QCOMPARE(expectedLevel, level); } -QVector DebuggerPlugin::createTestObjects() const +#endif // ifdef WITH_TESTS + +bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMessage) { - return {new DebuggerUnitTests}; + Q_UNUSED(errorMessage) + + // Needed for call from AppOutputPane::attachToRunControl() and GammarayIntegration. + ExtensionSystem::PluginManager::addObject(this); + + dd = new DebuggerPluginPrivate(arguments); + +#ifdef WITH_TESTS + addTest(); +#endif + + return true; } -#else // ^-- if WITH_TESTS else --v - -QVector DebuggerPlugin::createTestObjects() const -{ - return {}; -} - -#endif // if WITH_TESTS - } // Internal } // Debugger diff --git a/src/plugins/debugger/debuggerplugin.h b/src/plugins/debugger/debuggerplugin.h index 29e004ab508..209bd0454c4 100644 --- a/src/plugins/debugger/debuggerplugin.h +++ b/src/plugins/debugger/debuggerplugin.h @@ -3,8 +3,6 @@ #pragma once -#include "debugger_global.h" - #include #include @@ -42,8 +40,6 @@ private: QString *logMessage); Q_SLOT void removeDetectedDebuggers(const QString &detectionId, QString *logMessage); Q_SLOT void listDetectedDebuggers(const QString &detectionId, QString *logMessage); - - QVector createTestObjects() const override; }; } // Debugger::Internal