-
Add
CodeCoverage.cmake
file toscripts/cmake/
project directory -
Enable testing and add test coverage config to
CMakeLists.txt
(after test executable target setup, see full file):# # Create make test # enable_testing() add_test(unit-tests ${CMAKE_PROJECT_NAME}) ## Coverage set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake) include(CodeCoverage) setup_target_for_coverage(${CMAKE_PROJECT_NAME}_coverage ${CMAKE_PROJECT_NAME} coverage) SET(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage") SET(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
-
Coverage badge link:
https://codecov.io/gh/IlyaShkurenko/nsfilya/branch/master/graph/badge.svg