Files
jwt-cpp/cmake/code-coverage.cmake
Chris Mc 22e43afba8 adding coverage testing (#2)
* adding coverage testing

surprisingly:
Overall coverage rate:
  lines......: 80.6% (519 of 644 lines)
  functions..: 92.5% (235 of 254 functions)

* Update coverage.yml
2020-07-05 21:43:09 -04:00

16 lines
518 B
CMake

set(COVERAGE_CMAKE "${CMAKE_BINARY_DIR}/cmake/CodeCoverage.cmake")
if(NOT EXISTS ${COVERAGE_CMAKE})
set(COVERAGE_URL
"https://raw.githubusercontent.com/bilke/cmake-modules/master/CodeCoverage.cmake"
)
file(DOWNLOAD ${COVERAGE_URL} ${COVERAGE_CMAKE})
endif()
include(${COVERAGE_CMAKE})
function(setup_coverage TARGET)
target_compile_options(${TARGET} PRIVATE -g -O0 -fprofile-arcs
-ftest-coverage)
target_link_libraries(${TARGET} PRIVATE gcov)
endfunction()