diff --git a/src/plugins/autotest/boost/boosttestconstants.h b/src/plugins/autotest/boost/boosttestconstants.h index c56ca447a9d..8b8e668f04f 100644 --- a/src/plugins/autotest/boost/boosttestconstants.h +++ b/src/plugins/autotest/boost/boosttestconstants.h @@ -9,7 +9,7 @@ namespace Autotest { namespace BoostTest { namespace Constants { -const char FRAMEWORK_NAME[] = "Boost"; +const char FRAMEWORK_ID[] = "AutoTest.Framework.Boost"; const char FRAMEWORK_SETTINGS_CATEGORY[] = QT_TRANSLATE_NOOP("QtC::Autotest", "Boost Test"); const unsigned FRAMEWORK_PRIORITY = 11; const char BOOST_MASTER_SUITE[] = "Master Test Suite"; diff --git a/src/plugins/autotest/boost/boosttestframework.cpp b/src/plugins/autotest/boost/boosttestframework.cpp index 28c1b001be9..38f800357b4 100644 --- a/src/plugins/autotest/boost/boosttestframework.cpp +++ b/src/plugins/autotest/boost/boosttestframework.cpp @@ -28,7 +28,7 @@ BoostTestFramework::BoostTestFramework() { setActive(true); setSettingsGroups("Autotest", "BoostTest"); - setName(BoostTest::Constants::FRAMEWORK_NAME); + setId(BoostTest::Constants::FRAMEWORK_ID); setDisplayName(Tr::tr(BoostTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); setPriority(BoostTest::Constants::FRAMEWORK_PRIORITY); @@ -144,9 +144,8 @@ class BoostSettingsPage final : public Core::IOptionsPage public: BoostSettingsPage() { - setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix(QString("%1.%2") - .arg(BoostTest::Constants::FRAMEWORK_PRIORITY) - .arg(BoostTest::Constants::FRAMEWORK_NAME))); + setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix(QString("%1.Boost") + .arg(BoostTest::Constants::FRAMEWORK_PRIORITY))); setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); setDisplayName(Tr::tr(BoostTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); setSettingsProvider([] { return &theBoostTestFramework() ; }); diff --git a/src/plugins/autotest/boost/boosttestresult.cpp b/src/plugins/autotest/boost/boosttestresult.cpp index 80cca80cc4b..72d89dfcfe5 100644 --- a/src/plugins/autotest/boost/boosttestresult.cpp +++ b/src/plugins/autotest/boost/boosttestresult.cpp @@ -73,8 +73,8 @@ static ResultHooks::FindTestItemHook findTestItemHook(const FilePath &projectFil const QString &testSuiteName) { return [=](const TestResult &result) -> ITestTreeItem * { - const Id id = Id(Constants::FRAMEWORK_PREFIX).withSuffix(BoostTest::Constants::FRAMEWORK_NAME); - ITestFramework *framework = TestFrameworkManager::frameworkForId(id); + ITestFramework *framework = + TestFrameworkManager::frameworkForId(BoostTest::Constants::FRAMEWORK_ID); QTC_ASSERT(framework, return nullptr); const TestTreeItem *rootNode = framework->rootNode(); if (!rootNode) diff --git a/src/plugins/autotest/catch/catchtestframework.cpp b/src/plugins/autotest/catch/catchtestframework.cpp index b29a6aa7be6..8c312f65d15 100644 --- a/src/plugins/autotest/catch/catchtestframework.cpp +++ b/src/plugins/autotest/catch/catchtestframework.cpp @@ -29,7 +29,7 @@ CatchFramework::CatchFramework() setActive(true); setSettingsGroups("Autotest", "Catch2"); setPriority(12); - setName("Catch"); + setId("AutoTest.Framework.Catch"); setDisplayName(Tr::tr("Catch Test")); setLayouter([this] { diff --git a/src/plugins/autotest/ctest/ctesttool.cpp b/src/plugins/autotest/ctest/ctesttool.cpp index 885191eea23..2dee957194f 100644 --- a/src/plugins/autotest/ctest/ctesttool.cpp +++ b/src/plugins/autotest/ctest/ctesttool.cpp @@ -31,7 +31,7 @@ CTestTool::CTestTool() setActive(false); setSettingsGroups("Autotest", "CTest"); setAutoApply(false); - setName("CTest"); + setId("AutoTest.Framework.CTest"); setDisplayName(Tr::tr("CTest")); setLayouter([this] { @@ -171,7 +171,7 @@ class CTestToolSettingsPage final : public Core::IOptionsPage public: CTestToolSettingsPage() { - setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix(QString("255.CTest"))); + setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix("255.CTest")); setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); setDisplayName(Tr::tr("CTest")); setSettingsProvider([] { return &theCTestTool(); }); diff --git a/src/plugins/autotest/gtest/gtestconstants.h b/src/plugins/autotest/gtest/gtestconstants.h index 7d422e8df8b..e2a39b4b0df 100644 --- a/src/plugins/autotest/gtest/gtestconstants.h +++ b/src/plugins/autotest/gtest/gtestconstants.h @@ -9,7 +9,7 @@ namespace Autotest { namespace GTest { namespace Constants { -const char FRAMEWORK_NAME[] = "GTest"; +const char FRAMEWORK_ID[] = "Autotest.Framework.GTest"; const char FRAMEWORK_SETTINGS_CATEGORY[] = QT_TRANSLATE_NOOP("QtC::Autotest", "Google Test"); const unsigned FRAMEWORK_PRIORITY = 10; const char DEFAULT_FILTER[] = "*.*"; diff --git a/src/plugins/autotest/gtest/gtestframework.cpp b/src/plugins/autotest/gtest/gtestframework.cpp index 859fe38d376..8e54e1d7255 100644 --- a/src/plugins/autotest/gtest/gtestframework.cpp +++ b/src/plugins/autotest/gtest/gtestframework.cpp @@ -32,7 +32,7 @@ GTestFramework::GTestFramework() { setActive(true); setSettingsGroups("Autotest", "GTest"); - setName(GTest::Constants::FRAMEWORK_NAME); + setId(GTest::Constants::FRAMEWORK_ID); setDisplayName(Tr::tr(GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); setPriority(GTest::Constants::FRAMEWORK_PRIORITY); @@ -130,8 +130,7 @@ GTestFramework::GTestFramework() == GTest::Constants::GTestFilter); }); connect(this, &AspectContainer::applied, this, [] { - Id id = Id(Constants::FRAMEWORK_PREFIX).withSuffix(GTest::Constants::FRAMEWORK_NAME); - TestTreeModel::instance()->rebuild({id}); + TestTreeModel::instance()->rebuild({GTest::Constants::FRAMEWORK_ID}); }); } @@ -178,9 +177,8 @@ class GTestSettingsPage final : public Core::IOptionsPage public: GTestSettingsPage() { - setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix(QString("%1.%2") - .arg(GTest::Constants::FRAMEWORK_PRIORITY) - .arg(GTest::Constants::FRAMEWORK_NAME))); + setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix(QString("%1.GTest") + .arg(GTest::Constants::FRAMEWORK_PRIORITY))); setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); setDisplayName(Tr::tr(GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); setSettingsProvider([] { return &theGTestFramework(); }); diff --git a/src/plugins/autotest/gtest/gtestresult.cpp b/src/plugins/autotest/gtest/gtestresult.cpp index f34b8f069d7..070aa837d38 100644 --- a/src/plugins/autotest/gtest/gtestresult.cpp +++ b/src/plugins/autotest/gtest/gtestresult.cpp @@ -84,8 +84,7 @@ static ResultHooks::FindTestItemHook findTestItemHook(const FilePath &projectFil const QString &testCaseName) { return [=](const TestResult &result) -> ITestTreeItem * { - const Id id = Id(Constants::FRAMEWORK_PREFIX).withSuffix(GTest::Constants::FRAMEWORK_NAME); - ITestFramework *framework = TestFrameworkManager::frameworkForId(id); + ITestFramework *framework = TestFrameworkManager::frameworkForId(GTest::Constants::FRAMEWORK_ID); QTC_ASSERT(framework, return nullptr); const TestTreeItem *rootNode = framework->rootNode(); if (!rootNode) diff --git a/src/plugins/autotest/itestframework.cpp b/src/plugins/autotest/itestframework.cpp index 513fa96411d..4dd176b169c 100644 --- a/src/plugins/autotest/itestframework.cpp +++ b/src/plugins/autotest/itestframework.cpp @@ -15,11 +15,6 @@ namespace Autotest { ITestBase::ITestBase() {} -Id ITestBase::id() const -{ - return Id(Constants::FRAMEWORK_PREFIX).withSuffix(name()); -} - void ITestBase::resetRootNode() { if (!m_rootNode) diff --git a/src/plugins/autotest/itestframework.h b/src/plugins/autotest/itestframework.h index 8eff4e30458..ac7b85eda42 100644 --- a/src/plugins/autotest/itestframework.h +++ b/src/plugins/autotest/itestframework.h @@ -30,10 +30,9 @@ public: ITestBase(); virtual ~ITestBase() = default; - const char *name() const { return m_name; } QString displayName() const { return m_displayName; } TestBaseType type() const { return m_type; } - Utils::Id id() const; + Utils::Id id() const { return m_id; } int priority() const { return m_priority; } bool active() const { return m_active; } @@ -48,7 +47,7 @@ protected: void setPriority(int priority) { m_priority = priority; } void setDisplayName(const QString &displayName) { m_displayName = displayName; } void setType(const TestBaseType type) { m_type = type; } - void setName(const char *name) { m_name = name; } + void setId(const Utils::Id id) { m_id = id; } virtual ITestTreeItem *createRootNode() = 0; @@ -58,7 +57,7 @@ private: TestBaseType m_type = None; int m_priority = 0; QString m_displayName; - const char *m_name = nullptr; + Utils::Id m_id; friend class ITestFramework; friend class ITestTool; diff --git a/src/plugins/autotest/qtest/qttestconstants.h b/src/plugins/autotest/qtest/qttestconstants.h index 10042a1c961..d3e7a59334b 100644 --- a/src/plugins/autotest/qtest/qttestconstants.h +++ b/src/plugins/autotest/qtest/qttestconstants.h @@ -9,7 +9,7 @@ namespace Autotest { namespace QtTest { namespace Constants { -const char FRAMEWORK_NAME[] = "QtTest"; +const char FRAMEWORK_ID[] = "AutoTest.Framework.QtTest"; const char FRAMEWORK_SETTINGS_CATEGORY[] = QT_TRANSLATE_NOOP("QtC::Autotest", "Qt Test"); const unsigned FRAMEWORK_PRIORITY = 1; diff --git a/src/plugins/autotest/qtest/qttestframework.cpp b/src/plugins/autotest/qtest/qttestframework.cpp index bdbbc2b07d8..a406506a675 100644 --- a/src/plugins/autotest/qtest/qttestframework.cpp +++ b/src/plugins/autotest/qtest/qttestframework.cpp @@ -28,7 +28,7 @@ QtTestFramework &theQtTestFramework() QtTestFramework::QtTestFramework() { setActive(true); - setName(QtTest::Constants::FRAMEWORK_NAME); + setId(QtTest::Constants::FRAMEWORK_ID); setDisplayName(Tr::tr(QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); setPriority(QtTest::Constants::FRAMEWORK_PRIORITY); setSettingsGroups("Autotest", "QtTest"); @@ -144,9 +144,8 @@ class QtTestSettingPage final : public Core::IOptionsPage public: QtTestSettingPage() { - setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix(QString("%1.%2") - .arg(QtTest::Constants::FRAMEWORK_PRIORITY) - .arg(QtTest::Constants::FRAMEWORK_NAME))); + setId(Id(Constants::SETTINGSPAGE_PREFIX).withSuffix(QString("%1.QtTest") + .arg(QtTest::Constants::FRAMEWORK_PRIORITY))); setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); setDisplayName(Tr::tr(QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); setSettingsProvider([] { return &theQtTestFramework(); }); diff --git a/src/plugins/autotest/qtest/qttestresult.cpp b/src/plugins/autotest/qtest/qttestresult.cpp index 1f15b3e82dc..581a334efc6 100644 --- a/src/plugins/autotest/qtest/qttestresult.cpp +++ b/src/plugins/autotest/qtest/qttestresult.cpp @@ -130,8 +130,8 @@ static ResultHooks::FindTestItemHook findTestItemHook(const FilePath &projectFil { return [=](const TestResult &result) -> ITestTreeItem * { const Id id = type == TestType::QtTest - ? Id(Constants::FRAMEWORK_PREFIX).withSuffix(QtTest::Constants::FRAMEWORK_NAME) - : Id(Constants::FRAMEWORK_PREFIX).withSuffix(QuickTest::Constants::FRAMEWORK_NAME); + ? Id(QtTest::Constants::FRAMEWORK_ID) + : Id(QuickTest::Constants::FRAMEWORK_ID); ITestFramework *framework = TestFrameworkManager::frameworkForId(id); QTC_ASSERT(framework, return nullptr); const TestTreeItem *rootNode = framework->rootNode(); @@ -151,8 +151,8 @@ struct QtTestData TestType m_type; QString m_function; QString m_dataTag; - bool isTestFunction() const { return !m_function.isEmpty() && m_dataTag.isEmpty(); }; - bool isDataTag() const { return !m_function.isEmpty() && !m_dataTag.isEmpty(); }; + bool isTestFunction() const { return !m_function.isEmpty() && m_dataTag.isEmpty(); } + bool isDataTag() const { return !m_function.isEmpty() && !m_dataTag.isEmpty(); } }; static ResultHooks::DirectParentHook directParentHook(const QString &functionName, diff --git a/src/plugins/autotest/quick/quicktestframework.cpp b/src/plugins/autotest/quick/quicktestframework.cpp index 8e91638e553..875520a5e70 100644 --- a/src/plugins/autotest/quick/quicktestframework.cpp +++ b/src/plugins/autotest/quick/quicktestframework.cpp @@ -18,7 +18,7 @@ QuickTestFramework &theQuickTestFramework() QuickTestFramework::QuickTestFramework() { - setName(QuickTest::Constants::FRAMEWORK_NAME); + setId(QuickTest::Constants::FRAMEWORK_ID); setDisplayName(Tr::tr("Quick Test")); setPriority(5); } diff --git a/src/plugins/autotest/quick/quicktestframework.h b/src/plugins/autotest/quick/quicktestframework.h index a5de159671b..0bfc1f7c11d 100644 --- a/src/plugins/autotest/quick/quicktestframework.h +++ b/src/plugins/autotest/quick/quicktestframework.h @@ -11,7 +11,7 @@ namespace Autotest { namespace QuickTest { namespace Constants { -const char FRAMEWORK_NAME[] = "QtQuickTest"; +const char FRAMEWORK_ID[] = "Autotest.Framework.QtQuickTest"; } // namespace Constants } // namespace QuickTest