From 48c470b72cf32c49dc146f5859d67708759997b2 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Thu, 11 Jul 2019 22:57:21 +0200 Subject: rework diceparser to run unit tests --- tests/dice/CMakeLists.txt | 17 +++++++++++++++++ tests/dice/Dice.pro | 25 +++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 tests/dice/CMakeLists.txt create mode 100644 tests/dice/Dice.pro (limited to 'tests/dice') diff --git a/tests/dice/CMakeLists.txt b/tests/dice/CMakeLists.txt new file mode 100644 index 0000000..a0f27fd --- /dev/null +++ b/tests/dice/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.5) +project(tst_diceParser) + +enable_testing(true) + +# Tell CMake to run moc when necessary: +set(CMAKE_AUTOMOC ON) + +# As moc files are generated in the binary dir, tell CMake +# to always look for includes there: +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +find_package(Qt5Test REQUIRED) + +add_test(tst_diceParser tst_dice.cpp) + +target_link_libraries(foo Qt5::Test) diff --git a/tests/dice/Dice.pro b/tests/dice/Dice.pro new file mode 100644 index 0000000..9d24f91 --- /dev/null +++ b/tests/dice/Dice.pro @@ -0,0 +1,25 @@ +include(../tests.pri) + +SOURCES += \ + tst_dice.cpp + +TEMPLATE = app +TARGET= tst_diceParser +MOC_DIR=trash +OBJECTS_DIR=trash + +CONFIG+=testcase + +QT += testlib quick qml widgets + +INCLUDEPATH += $$ROLISTEAMSRC/diceparser/ +INCLUDEPATH += $$ROLISTEAMSRC/diceparser/node +INCLUDEPATH += $$ROLISTEAMSRC/diceparser/result + + +include($$ROLISTEAMSRC/diceparser/diceparser.pri) + +HEADERS -= ../../../rolisteam/client/diceparser/qmltypesregister.h +SOURCES -= ../../../rolisteam/client/diceparser/qmltypesregister.cpp + + -- cgit v1.2.3-70-g09d2