Skip to content
Snippets Groups Projects
Commit cf4bc7f8 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

coverage: make errors fatal

parent 47f0465c
No related branches found
No related tags found
No related merge requests found
...@@ -22,31 +22,31 @@ find_program(GENHTML_COMMAND genhtml) ...@@ -22,31 +22,31 @@ find_program(GENHTML_COMMAND genhtml)
if(GCOV_COMMAND) if(GCOV_COMMAND)
set(CMAKE_GCOV_FOUND TRUE) set(CMAKE_GCOV_FOUND TRUE)
else() else()
message(ERROR "could not locate gcov executable, cannot add code coverage custom target!") message(FATAL_ERROR "could not locate gcov executable, cannot add code coverage custom target!")
endif() endif()
if(LCOV_COMMAND) if(LCOV_COMMAND)
set(CMAKE_LCOV_FOUND TRUE) set(CMAKE_LCOV_FOUND TRUE)
else() else()
message(ERROR "could not locate lcov executable, cannot add code coverage custom target!") message(FATAL_ERROR "could not locate lcov executable, cannot add code coverage custom target!")
endif() endif()
if(GENHTML_COMMAND) if(GENHTML_COMMAND)
set(CMAKE_GENHTML_FOUND TRUE) set(CMAKE_GENHTML_FOUND TRUE)
else() else()
message(ERROR "could not locate genhtml executable, cannot add code coverage custom target!") message(FATAL_ERROR "could not locate genhtml executable, cannot add code coverage custom target!")
endif() endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU") if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
string(APPEND CMAKE_C_FLAGS " -coverage") string(APPEND CMAKE_C_FLAGS " -coverage")
else() else()
message(ERROR "C compiler is not GNU; don't know how to set code coverage flags!") message(FATAL_ERROR "C compiler is not GNU; don't know how to set code coverage flags!")
endif() endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
string(APPEND CMAKE_CXX_FLAGS " -coverage") string(APPEND CMAKE_CXX_FLAGS " -coverage")
else() else()
message(ERROR "CXX compiler is not GNU; don't know how to set code coverage flags!") message(FATAL_ERROR "CXX compiler is not GNU; don't know how to set code coverage flags!")
endif() endif()
# function to add a coverage target # function to add a coverage target
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment