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;
}
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<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
} // Debugger