forked from qt-creator/qt-creator
Vcpkg: Move test creation closer to tested code
Change-Id: Id135a9225bcc8806d89c7589d68f9c21200d9374 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -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"
|
||||
|
@@ -3,24 +3,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
#include <utils/aspects.h>
|
||||
#include <QObject>
|
||||
|
||||
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
|
||||
|
@@ -26,7 +26,7 @@ public:
|
||||
setupVcpkgManifestEditor();
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
addTest<VcpkgSearchTest>();
|
||||
addTestCreator(createVcpkgSearchTest);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user