diff --git a/src/plugins/vcpkg/vcpkg_test.cpp b/src/plugins/vcpkg/vcpkg_test.cpp index 71e3d50a848..1c2918b4097 100644 --- a/src/plugins/vcpkg/vcpkg_test.cpp +++ b/src/plugins/vcpkg/vcpkg_test.cpp @@ -10,11 +10,16 @@ namespace Vcpkg::Internal { -VcpkgSearchTest::VcpkgSearchTest(QObject *parent) - : QObject(parent) -{ } +class VcpkgSearchTest : public QObject +{ + Q_OBJECT -VcpkgSearchTest::~VcpkgSearchTest() = default; +private slots: + void testVcpkgJsonParser_data(); + void testVcpkgJsonParser(); + void testAddDependency_data(); + void testAddDependency(); +}; void VcpkgSearchTest::testVcpkgJsonParser_data() { @@ -178,4 +183,11 @@ void VcpkgSearchTest::testAddDependency() QCOMPARE(QString::fromUtf8(result), modifiedVcpkgManifestJsonData); } +QObject *createVcpkgSearchTest() +{ + return new VcpkgSearchTest; +} + } // namespace Vcpkg::Internal + +#include "vcpkg_test.moc" diff --git a/src/plugins/vcpkg/vcpkg_test.h b/src/plugins/vcpkg/vcpkg_test.h index 2bc386e7aa1..d66cc704316 100644 --- a/src/plugins/vcpkg/vcpkg_test.h +++ b/src/plugins/vcpkg/vcpkg_test.h @@ -3,24 +3,10 @@ #pragma once -#include -#include +#include namespace Vcpkg::Internal { -class VcpkgSearchTest : public QObject -{ - Q_OBJECT - -public: - VcpkgSearchTest(QObject *parent = nullptr); - ~VcpkgSearchTest(); - -private slots: - void testVcpkgJsonParser_data(); - void testVcpkgJsonParser(); - void testAddDependency_data(); - void testAddDependency(); -}; +QObject *createVcpkgSearchTest(); } // namespace Vcpkg::Internal diff --git a/src/plugins/vcpkg/vcpkgplugin.cpp b/src/plugins/vcpkg/vcpkgplugin.cpp index 2247bda2cf5..cc3abc097da 100644 --- a/src/plugins/vcpkg/vcpkgplugin.cpp +++ b/src/plugins/vcpkg/vcpkgplugin.cpp @@ -26,7 +26,7 @@ public: setupVcpkgManifestEditor(); #ifdef WITH_TESTS - addTest(); + addTestCreator(createVcpkgSearchTest); #endif }