Permalink
Browse files

Improves CTest support

Issue: #61
  • Loading branch information...
kpp committed Mar 29, 2015
1 parent 23c05a5 commit 152b324089b28e7270a20cb5fbc410179103c433
Showing with 35 additions and 0 deletions.
  1. +9 −0 CMakeLists.txt
  2. +6 −0 CTestConfig.cmake
  3. +5 −0 cmake/CTestCustom.cmake.in
  4. +15 −0 tests/CMakeLists.txt
View
@@ -70,6 +70,15 @@ else()
endif()
option(BUILD_TESTS "Should we build tests?" OFF)
if (BUILD_TESTS)
enable_testing()
configure_file( "${CMAKE_SOURCE_DIR}/cmake/CTestCustom.cmake.in" "${CMAKE_BINARY_DIR}/CTestCustom.cmake" @ONLY)
include(CTest)
add_subdirectory(tests)
endif()
add_subdirectory(doc)
add_subdirectory(image)
add_subdirectory(src)
View
@@ -0,0 +1,6 @@
set(CTEST_PROJECT_NAME "LLST")
set(CTEST_NIGHTLY_START_TIME "00:00:00 UTC")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "my.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=LLST")
set(CTEST_DROP_SITE_CDASH TRUE)
@@ -0,0 +1,5 @@
# Complete list of options is available at http://cmake.org/Wiki/CMake/Testing_With_CTest
SET(CTEST_CUSTOM_MEMCHECK_IGNORE ${CTEST_CUSTOM_MEMCHECK_IGNORE} )
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE ${CTEST_CUSTOM_COVERAGE_EXCLUDE} )
SET(CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} )
View
@@ -0,0 +1,15 @@
find_package(GTest REQUIRED)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
macro(cxx_test pretty_name bin_name sources libs)
add_executable(${bin_name} EXCLUDE_FROM_ALL ${sources})
target_link_libraries(${bin_name} ${libs} ${GTEST_BOTH_LIBRARIES})
set_target_properties(${bin_name} PROPERTIES COMPILE_DEFINITIONS TESTS_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/\")
add_test(${pretty_name} ${bin_name})
add_dependencies(check ${bin_name})
endmacro()
include_directories(${CMAKE_SOURCE_DIR}/include)

0 comments on commit 152b324

Please sign in to comment.