Simplify code coverage implementation

This commit is contained in:
Drew DeVault 2016-06-19 12:28:34 -04:00
parent 074238e9f4
commit 8758a2bd04
5 changed files with 30 additions and 196 deletions

View file

@ -1,5 +1,3 @@
find_package(A2X REQUIRED)
function(configure_test)
set(options)
set(oneValueArgs NAME SUBPROJECT)
@ -25,7 +23,7 @@ function(configure_test)
list(APPEND CONFIGURE_TEST_WRAPPERS "malloc" "calloc" "realloc" "free")
if (enable-coverage)
add_compile_options(-g -O0 --coverage -fprofile-arcs -ftest-coverage)
add_definitions(-g -O0 --coverage -fprofile-arcs -ftest-coverage)
endif()
list(LENGTH CONFIGURE_TEST_WRAPPERS WRAPPED_COUNT)
@ -51,10 +49,5 @@ function(configure_test)
if (enable-coverage)
target_link_libraries(${CONFIGURE_TEST_NAME}_test gcov)
setup_target_for_coverage(
${CONFIGURE_TEST_NAME}_cov
${CONFIGURE_TEST_NAME}_test
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/coverage
)
endif()
endfunction()