diff options
Diffstat (limited to 'src/Simplex_tree/test/CMakeLists.txt')
-rw-r--r-- | src/Simplex_tree/test/CMakeLists.txt | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/Simplex_tree/test/CMakeLists.txt b/src/Simplex_tree/test/CMakeLists.txt index a15ac04e..02ef9d8b 100644 --- a/src/Simplex_tree/test/CMakeLists.txt +++ b/src/Simplex_tree/test/CMakeLists.txt @@ -1,11 +1,21 @@ cmake_minimum_required(VERSION 2.6) project(GUDHITestSimplexTree) -# NEED TO FIND BOOST NEEDED COMPONENTS TO LINK WITH -find_package(Boost 1.45.0 COMPONENTS system unit_test_framework) -message("Boost_lib = ${Boost_LIBRARIES}") +if(NOT MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} --coverage") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} --coverage") +endif() -include_directories(${Boost_INCLUDE_DIRS}) -add_executable ( TestSimplexTree UnitTestSimplexTree.cpp ) -target_link_libraries(TestSimplexTree ${Boost_LIBRARIES}) +add_executable ( simplex_tree_unit_test simplex_tree_unit_test.cpp ) +target_link_libraries(simplex_tree_unit_test ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) +# Unitary tests +add_test(simplex_tree_unit_test ${CMAKE_CURRENT_BINARY_DIR}/simplex_tree_unit_test) + +if (LCOV_PATH) + # Lcov code coverage of unitary test + add_test(src/Simplex_tree/lcov/coverage.log ${CMAKE_SOURCE_DIR}/scripts/check_code_coverage.sh ${CMAKE_SOURCE_DIR}/src/Simplex_tree) +endif() + +cpplint_add_tests("${CMAKE_SOURCE_DIR}/src/Simplex_tree/include/gudhi") |