diff options
author | Florent Le Coz <louiz@louiz.org> | 2015-10-28 19:13:53 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2015-10-29 02:32:57 +0100 |
commit | 3c1889fbd0d7b96aae16f3479ac8aae70a7e15f7 (patch) | |
tree | 69c90435a43b906115b34d4542122000571b971e /CMakeLists.txt | |
parent | 4e32fe213cccdc6cdc1dcba498fd74b8b97703ea (diff) | |
download | biboumi-3c1889fbd0d7b96aae16f3479ac8aae70a7e15f7.tar.gz biboumi-3c1889fbd0d7b96aae16f3479ac8aae70a7e15f7.tar.bz2 biboumi-3c1889fbd0d7b96aae16f3479ac8aae70a7e15f7.tar.xz biboumi-3c1889fbd0d7b96aae16f3479ac8aae70a7e15f7.zip |
Use Catch for our test suite
`make check` is also added to compile and run the tests
Catch is fetched with cmake automatically into the build directory when needed
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b16b906..960b5d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,12 +145,13 @@ if(SYSTEMD_FOUND) target_link_libraries(xmpp ${SYSTEMD_LIBRARIES}) endif() - # ## Tests # +file(GLOB source_tests + tests/*.cpp) add_executable(test_suite EXCLUDE_FROM_ALL - src/test.cpp) + ${source_tests}) target_link_libraries(test_suite xmpplib xmpp @@ -160,11 +161,26 @@ target_link_libraries(test_suite config logger network) - if(USE_DATABASE) target_link_libraries(test_suite database) endif() +include(ExternalProject) +ExternalProject_Add(catch + GIT_REPOSITORY "https://github.com/philsquared/Catch.git" + PREFIX "external" + UPDATE_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" +) +ExternalProject_Get_Property(catch SOURCE_DIR) +target_include_directories(test_suite + PUBLIC "${SOURCE_DIR}/include/" +) +add_dependencies(test_suite catch) +add_custom_target(check COMMAND "test_suite" + DEPENDS test_suite) # ## Install target |