Debugger: Use new plugin test object setup

Change-Id: Ic97dfd9aa22c4c8e41f81478983fb79760a76807
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2023-02-09 10:14:59 +01:00
parent f3b58359fd
commit b4f665f8ac
2 changed files with 15 additions and 26 deletions

View File

@@ -2125,17 +2125,6 @@ DebuggerPlugin::~DebuggerPlugin()
m_instance = nullptr; 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() IPlugin::ShutdownFlag DebuggerPlugin::aboutToShutdown()
{ {
ExtensionSystem::PluginManager::removeObject(this); ExtensionSystem::PluginManager::removeObject(this);
@@ -2489,20 +2478,24 @@ void DebuggerUnitTests::testDebuggerMatching()
QCOMPARE(expectedLevel, level); QCOMPARE(expectedLevel, level);
} }
QVector<QObject *> 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<DebuggerUnitTests>();
#endif
return true;
} }
#else // ^-- if WITH_TESTS else --v
QVector<QObject *> DebuggerPlugin::createTestObjects() const
{
return {};
}
#endif // if WITH_TESTS
} // Internal } // Internal
} // Debugger } // Debugger

View File

@@ -3,8 +3,6 @@
#pragma once #pragma once
#include "debugger_global.h"
#include <extensionsystem/iplugin.h> #include <extensionsystem/iplugin.h>
#include <utils/filepath.h> #include <utils/filepath.h>
@@ -42,8 +40,6 @@ private:
QString *logMessage); QString *logMessage);
Q_SLOT void removeDetectedDebuggers(const QString &detectionId, QString *logMessage); Q_SLOT void removeDetectedDebuggers(const QString &detectionId, QString *logMessage);
Q_SLOT void listDetectedDebuggers(const QString &detectionId, QString *logMessage); Q_SLOT void listDetectedDebuggers(const QString &detectionId, QString *logMessage);
QVector<QObject *> createTestObjects() const override;
}; };
} // Debugger::Internal } // Debugger::Internal