From 7eeee52fb49a989cbfa05e84a866a7d46078866b Mon Sep 17 00:00:00 2001 From: Jonas Mucke Date: Thu, 9 Jan 2020 21:07:36 +0100 Subject: [PATCH] Startingh UnitTesting --- src/UnitTest.pro | 57 ++++++++++++++++++++++++++++++++++++++++++++ src/mainUnitTest.cpp | 49 +++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 src/UnitTest.pro create mode 100644 src/mainUnitTest.cpp diff --git a/src/UnitTest.pro b/src/UnitTest.pro new file mode 100644 index 0000000..c61749e --- /dev/null +++ b/src/UnitTest.pro @@ -0,0 +1,57 @@ +QT += testlib +QT += gui +CONFIG += qt warn_on depend_includepath testcase + +TEMPLATE = app + +SOURCES += \ + GUI/IntelliPhotoGui.cpp \ + Image/IntelliImage.cpp \ + Image/IntelliRasterImage.cpp \ + Image/IntelliShapedImage.cpp \ + IntelliHelper/IntelliColorPicker.cpp \ + IntelliHelper/IntelliRenderSettings.cpp \ + IntelliHelper/IntelliToolsettings.cpp \ + IntelliHelper/IntelliTriangulation.cpp \ + Layer/PaintingArea.cpp \ + Tool/IntelliColorPicker.cpp \ + Tool/IntelliTool.cpp \ + Tool/IntelliToolCircle.cpp \ + Tool/IntelliToolFloodFill.cpp \ + Tool/IntelliToolLine.cpp \ + Tool/IntelliToolPen.cpp \ + Tool/IntelliToolPlain.cpp \ + Tool/IntelliToolPolygon.cpp \ + Tool/IntelliToolRectangle.cpp \ + mainUnitTest.cpp + +DISTFILES += \ + icons/Wechselpfeile.png \ + icons/circle-tool.svg \ + icons/eraser-tool.svg \ + icons/flood-fill-tool.svg \ + icons/icon.png \ + icons/line-tool.svg \ + icons/pen-tool.svg \ + icons/plain-tool.svg \ + icons/polygon-tool.svg \ + icons/rectangle-tool.svg + +HEADERS += \ + GUI/IntelliPhotoGui.h \ + Image/IntelliImage.h \ + Image/IntelliRasterImage.h \ + Image/IntelliShapedImage.h \ + IntelliHelper/IntelliColorPicker.h \ + IntelliHelper/IntelliRenderSettings.h \ + IntelliHelper/IntelliToolsettings.h \ + IntelliHelper/IntelliTriangulation.h \ + Layer/PaintingArea.h \ + Tool/IntelliTool.h \ + Tool/IntelliToolCircle.h \ + Tool/IntelliToolFloodFill.h \ + Tool/IntelliToolLine.h \ + Tool/IntelliToolPen.h \ + Tool/IntelliToolPlain.h \ + Tool/IntelliToolPolygon.h \ + Tool/IntelliToolRectangle.h diff --git a/src/mainUnitTest.cpp b/src/mainUnitTest.cpp new file mode 100644 index 0000000..75fb0d6 --- /dev/null +++ b/src/mainUnitTest.cpp @@ -0,0 +1,49 @@ +#include + +// add necessary includes here + +class UnitTest : public QObject +{ + Q_OBJECT + +public: + UnitTest(); + ~UnitTest(); + +private slots: + void initTestCase(); + void cleanupTestCase(); + void test_case1(); + +}; + +UnitTest::UnitTest() +{ + +} + +UnitTest::~UnitTest() +{ + +} + +void UnitTest::initTestCase() +{ + +} + +void UnitTest::cleanupTestCase() +{ + +} + +void UnitTest::test_case1() +{ + QBENCHMARK { + QVERIFY(1 == 1); + } +} + +QTEST_APPLESS_MAIN(UnitTest) + +#include "tst_unittest.moc"