diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-09-03 17:10:50 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-10-30 10:36:49 -0700 |
commit | 044e593957acc8de045c02003fa468bd76c98767 (patch) | |
tree | 103e087ec6cf1b594c0ad0db1fab3430c5c4ff9a /tests | |
parent | 1d6683f3e07d9a73af5fab702bc3a551ec7dabc9 (diff) | |
download | subsurface-044e593957acc8de045c02003fa468bd76c98767.tar.gz |
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 <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 28 |
1 files changed, 28 insertions, 0 deletions
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 $<TARGET_FILE:${NAME}>) +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 |