From 044e593957acc8de045c02003fa468bd76c98767 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 3 Sep 2015 17:10:50 -0300 Subject: CMake for tests in its own folder Besides making it more simple to add a new test now since you don't need to play hide and seek with the main cmake this has another good thing: on IDE's that scan the cmake to create targets on the project tree, the main project was being popullated with test-targets on the main tree and not inside the tests directory. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- tests/CMakeLists.txt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/CMakeLists.txt (limited to 'tests/CMakeLists.txt') diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 000000000..0b322d053 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,28 @@ +# QTest based tests +macro(TEST NAME FILE) + add_executable(${NAME} ${FILE} ${SUBSURFACE_RESOURCES}) + target_link_libraries(${NAME} subsurface_corelib ${QT_TEST_LIBRARIES} ${SUBSURFACE_LINK_LIBRARIES}) + add_test(NAME ${NAME} COMMAND $) +endmacro() + +enable_testing() +add_definitions(-g) +TEST(TestUnitConversion testunitconversion.cpp) +TEST(TestProfile testprofile.cpp) +TEST(TestGpsCoords testgpscoords.cpp) +TEST(TestParse testparse.cpp) +TEST(TestPlan testplan.cpp) +TEST(TestDiveSiteDuplication testdivesiteduplication.cpp) +TEST(TestRenumber testrenumber.cpp) +TEST(TestGitStorage testgitstorage.cpp) + +add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} + DEPENDS + TestUnitConversion + TestProfile + TestGpsCoords + TestParse + TestGitStorage + TestPlan + TestDiveSiteDuplication +) \ No newline at end of file -- cgit v1.2.3-70-g09d2