McuSupport: Use new plugin test setup

And some code cosmetics.

Change-Id: Ia2831256a9a662d79a3736aefd7cc75760712f4c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-02-09 10:52:16 +01:00
parent c0cce829b5
commit 3685ef0f37
2 changed files with 9 additions and 22 deletions

View File

@@ -41,12 +41,9 @@
using namespace Core; using namespace Core;
using namespace ProjectExplorer; using namespace ProjectExplorer;
namespace { namespace McuSupport::Internal {
constexpr char setupMcuSupportKits[]{"SetupMcuSupportKits"};
}
namespace McuSupport { const char setupMcuSupportKits[] = "SetupMcuSupportKits";
namespace Internal {
void printMessage(const QString &message, bool important) void printMessage(const QString &message, bool important)
{ {
@@ -125,6 +122,10 @@ void McuSupportPlugin::initialize()
dd->m_options.registerQchFiles(); dd->m_options.registerQchFiles();
dd->m_options.registerExamples(); dd->m_options.registerExamples();
ProjectExplorer::JsonWizardFactory::addWizardPath(":/mcusupport/wizards/"); ProjectExplorer::JsonWizardFactory::addWizardPath(":/mcusupport/wizards/");
#if defined(WITH_TESTS) && defined(GOOGLE_TEST_IS_FOUND)
addTest<Test::McuSupportTest>();
#endif
} }
void McuSupportPlugin::extensionsInitialized() void McuSupportPlugin::extensionsInitialized()
@@ -189,14 +190,4 @@ void McuSupportPlugin::askUserAboutMcuSupportKitsUpgrade(const SettingsHandler::
ICore::infoBar()->addInfo(info); ICore::infoBar()->addInfo(info);
} }
QVector<QObject *> McuSupportPlugin::createTestObjects() const } // McuSupport::Internal
{
QVector<QObject *> tests;
#if defined(WITH_TESTS) && defined(GOOGLE_TEST_IS_FOUND)
tests << new Test::McuSupportTest;
#endif
return tests;
}
} // namespace Internal
} // namespace McuSupport

View File

@@ -24,10 +24,6 @@ public:
void askUserAboutMcuSupportKitsSetup(); void askUserAboutMcuSupportKitsSetup();
static void askUserAboutMcuSupportKitsUpgrade(const SettingsHandler::Ptr &settingsHandler); static void askUserAboutMcuSupportKitsUpgrade(const SettingsHandler::Ptr &settingsHandler);
};
private: } // McuSupport::Internal
QVector<QObject *> createTestObjects() const final;
}; // class McuSupportPlugin
} // namespace McuSupport::Internal