From 714ca1c4f97a362ac27d101795551b7255a6c29d Mon Sep 17 00:00:00 2001 From: John Janus Date: Tue, 13 Aug 2019 15:53:01 +0200 Subject: [PATCH] restructure project to include tests --- .gitignore | 4 +- .../splittermond-assistant-tests.pro | 9 ++++ splittermond-assistant-tests/tst_test.cpp | 47 +++++++++++++++++++ splittermond-assistant-top.pro | 3 ++ .../resources}/views.qrc | 0 .../resources}/views/main.qml | 0 .../splittermond-assistant.pro | 6 +-- .../src}/character.cpp | 0 .../src}/character.h | 0 {src => splittermond-assistant/src}/main.cpp | 0 .../style.astylerc | 0 11 files changed, 64 insertions(+), 5 deletions(-) create mode 100644 splittermond-assistant-tests/splittermond-assistant-tests.pro create mode 100644 splittermond-assistant-tests/tst_test.cpp create mode 100644 splittermond-assistant-top.pro rename {resources => splittermond-assistant/resources}/views.qrc (100%) rename {resources => splittermond-assistant/resources}/views/main.qml (100%) rename splittermond-assistant.pro => splittermond-assistant/splittermond-assistant.pro (92%) rename {src => splittermond-assistant/src}/character.cpp (100%) rename {src => splittermond-assistant/src}/character.h (100%) rename {src => splittermond-assistant/src}/main.cpp (100%) rename style.astylerc => splittermond-assistant/style.astylerc (100%) diff --git a/.gitignore b/.gitignore index 495b778..a886c04 100644 --- a/.gitignore +++ b/.gitignore @@ -34,8 +34,8 @@ Thumbs.db *.rc /.qmake.cache /.qmake.stash -/build/ -/binaries/ +build/ +binaries/ # qtcreator generated files *.pro.user* diff --git a/splittermond-assistant-tests/splittermond-assistant-tests.pro b/splittermond-assistant-tests/splittermond-assistant-tests.pro new file mode 100644 index 0000000..d2d7b7f --- /dev/null +++ b/splittermond-assistant-tests/splittermond-assistant-tests.pro @@ -0,0 +1,9 @@ +QT += testlib +QT -= gui + +CONFIG += qt console warn_on depend_includepath testcase +CONFIG -= app_bundle + +TEMPLATE = app + +SOURCES += tst_test.cpp diff --git a/splittermond-assistant-tests/tst_test.cpp b/splittermond-assistant-tests/tst_test.cpp new file mode 100644 index 0000000..91bf4ed --- /dev/null +++ b/splittermond-assistant-tests/tst_test.cpp @@ -0,0 +1,47 @@ +#include + +// add necessary includes here + +class Test : public QObject +{ + Q_OBJECT + +public: + Test(); + ~Test(); + +private slots: + void initTestCase(); + void cleanupTestCase(); + void test_case1(); + +}; + +Test::Test() +{ + +} + +Test::~Test() +{ + +} + +void Test::initTestCase() +{ + +} + +void Test::cleanupTestCase() +{ + +} + +void Test::test_case1() +{ + +} + +QTEST_APPLESS_MAIN(Test) + +#include "tst_test.moc" diff --git a/splittermond-assistant-top.pro b/splittermond-assistant-top.pro new file mode 100644 index 0000000..9ce9c2d --- /dev/null +++ b/splittermond-assistant-top.pro @@ -0,0 +1,3 @@ +TEMPLATE = subdirs +SUBDIRS += splittermond-assistant \ + splittermond-assistant-tests diff --git a/resources/views.qrc b/splittermond-assistant/resources/views.qrc similarity index 100% rename from resources/views.qrc rename to splittermond-assistant/resources/views.qrc diff --git a/resources/views/main.qml b/splittermond-assistant/resources/views/main.qml similarity index 100% rename from resources/views/main.qml rename to splittermond-assistant/resources/views/main.qml diff --git a/splittermond-assistant.pro b/splittermond-assistant/splittermond-assistant.pro similarity index 92% rename from splittermond-assistant.pro rename to splittermond-assistant/splittermond-assistant.pro index 4dc6d79..29e46c7 100644 --- a/splittermond-assistant.pro +++ b/splittermond-assistant/splittermond-assistant.pro @@ -1,5 +1,5 @@ -include(qmake-target-platform.pri) -include(qmake-destination-path.pri) +include(../qmake-target-platform.pri) +include(../qmake-destination-path.pri) QT += qml quick xml CONFIG += c++17 @@ -41,7 +41,7 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin DISTFILES += \ style.astylerc -DESTDIR = $$PWD/binaries/$$DESTINATION_PATH +DESTDIR = $$PWD/../binaries/$$DESTINATION_PATH OBJECTS_DIR = $$PWD/build/$$DESTINATION_PATH/.obj MOC_DIR = $$PWD/build/$$DESTINATION_PATH/.moc RCC_DIR = $$PWD/build/$$DESTINATION_PATH/.qrc diff --git a/src/character.cpp b/splittermond-assistant/src/character.cpp similarity index 100% rename from src/character.cpp rename to splittermond-assistant/src/character.cpp diff --git a/src/character.h b/splittermond-assistant/src/character.h similarity index 100% rename from src/character.h rename to splittermond-assistant/src/character.h diff --git a/src/main.cpp b/splittermond-assistant/src/main.cpp similarity index 100% rename from src/main.cpp rename to splittermond-assistant/src/main.cpp diff --git a/style.astylerc b/splittermond-assistant/style.astylerc similarity index 100% rename from style.astylerc rename to splittermond-assistant/style.astylerc -- 2.48.1