Skip to content

Commit

Permalink
Better coverage dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
PJK committed Apr 26, 2015
1 parent 3f60e9b commit 3bae447
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ add_custom_target(coverage
COMMAND genhtml coverage.info --highlight --legend --output-directory coverage_html
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_SOURCE_DIR}/test/stream_expectations.c
COMMAND echo "Coverage report ready: file://${CMAKE_CURRENT_BINARY_DIR}/coverage_html/index.html")

include_directories(src)


Expand All @@ -32,7 +31,7 @@ endif(CUSTOM_ALLOC)
option(COVERAGE "Enable code coverage instrumentation" OFF)
if(COVERAGE)
message("Configuring code coverage instrumentation")
if(NOT CMAKE_C_COMPILER EQUAL "gcc")
if(NOT CMAKE_C_COMPILER MATCHES "gcc")
message(WARNING "Gcov instrumentation only works with GCC")
endif()
# https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html
Expand Down
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ foreach(TEST ${TESTS})
target_link_libraries(${NAME} cmocka)
target_link_libraries(${NAME} cbor)
add_test(${NAME} ${NAME})
add_dependencies(coverage ${NAME})

add_custom_command(TARGET ${NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_SOURCE_DIR}/stream_expectations.c
Expand Down

0 comments on commit 3bae447

Please sign in to comment.