mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
1d6683f3e0
commit
044e593957
2 changed files with 34 additions and 25 deletions
28
tests/CMakeLists.txt
Normal file
28
tests/CMakeLists.txt
Normal file
|
|
@ -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
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue