mirror of
https://github.com/TheLartians/ModernCppStarter.git
synced 2025-09-05 16:31:01 +02:00
Replace old code coverage with code-coverage.cmake
TODO: * Figure out how to exclude dependencies from code coverage reports * Modify GitHub Actions workflows Aims to fix #124
This commit is contained in:
parent
acab9a3b78
commit
3ce7e5ccd3
2 changed files with 8 additions and 6 deletions
|
@ -7,6 +7,8 @@ project(GreeterTests LANGUAGES CXX)
|
|||
option(ENABLE_TEST_COVERAGE "Enable test coverage" OFF)
|
||||
option(TEST_INSTALLED_VERSION "Test the version found by find_package" OFF)
|
||||
|
||||
set(CODE_COVERAGE ${ENABLE_TEST_COVERAGE})
|
||||
|
||||
# --- Import tools ----
|
||||
|
||||
include(../cmake/tools.cmake)
|
||||
|
@ -53,7 +55,5 @@ doctest_discover_tests(GreeterTests)
|
|||
|
||||
# ---- code coverage ----
|
||||
|
||||
if(ENABLE_TEST_COVERAGE)
|
||||
target_compile_options(Greeter PUBLIC -O0 -g -fprofile-arcs -ftest-coverage)
|
||||
target_link_options(Greeter PUBLIC -fprofile-arcs -ftest-coverage)
|
||||
endif()
|
||||
target_code_coverage(Greeter)
|
||||
target_code_coverage(GreeterTests AUTO)
|
Loading…
Add table
Add a link
Reference in a new issue