From ce3306ccb3699c400fe2090c65b0f873625665a8 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 17 Apr 2020 13:44:30 +0200 Subject: [PATCH] AutoTest: Do not inherit from another framework Commit 91509727e062b6 had some unexpected side effect. Amend (or replace) this one by an explicit lookup which is still a hack, but at least safe to do. Change-Id: I8fd2e9bdcea18d062f6fc6dd74709c12c16f2cc5 Reviewed-by: hjk --- src/plugins/autotest/quick/quicktestframework.cpp | 11 +++++++++++ src/plugins/autotest/quick/quicktestframework.h | 7 ++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/plugins/autotest/quick/quicktestframework.cpp b/src/plugins/autotest/quick/quicktestframework.cpp index fc6b1e34d11..50d46c7e1e4 100644 --- a/src/plugins/autotest/quick/quicktestframework.cpp +++ b/src/plugins/autotest/quick/quicktestframework.cpp @@ -27,6 +27,9 @@ #include "quicktestparser.h" #include "quicktesttreeitem.h" +#include "../testframeworkmanager.h" +#include "../qtest/qttestconstants.h" + namespace Autotest { namespace Internal { @@ -51,5 +54,13 @@ unsigned QuickTestFramework::priority() const return 5; } +IFrameworkSettings *QuickTestFramework::frameworkSettings() +{ + static const Core::Id id + = Core::Id(Constants::FRAMEWORK_PREFIX).withSuffix(QtTest::Constants::FRAMEWORK_NAME); + ITestFramework *qtTestFramework = TestFrameworkManager::frameworkForId(id); + return qtTestFramework->frameworkSettings(); +} + } // namespace Internal } // namespace Autotest diff --git a/src/plugins/autotest/quick/quicktestframework.h b/src/plugins/autotest/quick/quicktestframework.h index deb3b499a21..a50b224c8da 100644 --- a/src/plugins/autotest/quick/quicktestframework.h +++ b/src/plugins/autotest/quick/quicktestframework.h @@ -25,7 +25,7 @@ #pragma once -#include "../qtest/qttestframework.h" +#include "../itestframework.h" namespace Autotest { namespace QuickTest { @@ -38,12 +38,13 @@ const char FRAMEWORK_NAME[] = "QtQuickTest"; namespace Internal { -class QuickTestFramework : public QtTestFramework +class QuickTestFramework : public ITestFramework { public: - QuickTestFramework() = default; + QuickTestFramework() : ITestFramework(true) {} const char *name() const override; unsigned priority() const override; + IFrameworkSettings *frameworkSettings() override; protected: ITestParser *createTestParser() override;