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 {
|
namespace Vcpkg::Internal {
|
||||||
|
|
||||||
VcpkgSearchTest::VcpkgSearchTest(QObject *parent)
|
class VcpkgSearchTest : public QObject
|
||||||
: QObject(parent)
|
{
|
||||||
{ }
|
Q_OBJECT
|
||||||
|
|
||||||
VcpkgSearchTest::~VcpkgSearchTest() = default;
|
private slots:
|
||||||
|
void testVcpkgJsonParser_data();
|
||||||
|
void testVcpkgJsonParser();
|
||||||
|
void testAddDependency_data();
|
||||||
|
void testAddDependency();
|
||||||
|
};
|
||||||
|
|
||||||
void VcpkgSearchTest::testVcpkgJsonParser_data()
|
void VcpkgSearchTest::testVcpkgJsonParser_data()
|
||||||
{
|
{
|
||||||
@@ -178,4 +183,11 @@ void VcpkgSearchTest::testAddDependency()
|
|||||||
QCOMPARE(QString::fromUtf8(result), modifiedVcpkgManifestJsonData);
|
QCOMPARE(QString::fromUtf8(result), modifiedVcpkgManifestJsonData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QObject *createVcpkgSearchTest()
|
||||||
|
{
|
||||||
|
return new VcpkgSearchTest;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Vcpkg::Internal
|
} // namespace Vcpkg::Internal
|
||||||
|
|
||||||
|
#include "vcpkg_test.moc"
|
||||||
|
@@ -3,24 +3,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
#include <QObject>
|
||||||
#include <utils/aspects.h>
|
|
||||||
|
|
||||||
namespace Vcpkg::Internal {
|
namespace Vcpkg::Internal {
|
||||||
|
|
||||||
class VcpkgSearchTest : public QObject
|
QObject *createVcpkgSearchTest();
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
VcpkgSearchTest(QObject *parent = nullptr);
|
|
||||||
~VcpkgSearchTest();
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void testVcpkgJsonParser_data();
|
|
||||||
void testVcpkgJsonParser();
|
|
||||||
void testAddDependency_data();
|
|
||||||
void testAddDependency();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Vcpkg::Internal
|
} // namespace Vcpkg::Internal
|
||||||
|
@@ -26,7 +26,7 @@ public:
|
|||||||
setupVcpkgManifestEditor();
|
setupVcpkgManifestEditor();
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
addTest<VcpkgSearchTest>();
|
addTestCreator(createVcpkgSearchTest);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user