-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathCoverage.cmake
More file actions
28 lines (24 loc) · 1.1 KB
/
Coverage.cmake
File metadata and controls
28 lines (24 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Enable coverate report target and compilation options, requires gcovr
# In this project, 100% tests coverage does not actually mean much, because the most useful
# test cases are around overload resolution, parameter dispatch, value categories,
# concepts etc. elements of the language which may not show in the coverage tests.
# This means that we need many more tests than just the minimum needed to ensure "good" coverage.
set(CODE_COVERAGE_VERBOSE ON)
set(CODE_COVERAGE_FORMAT "xml" CACHE STRING "Format of the coverage report.")
set(CODE_COVERAGE_TEST "ctest" CACHE STRING "Command to run tests.")
set(CODE_COVERAGE_TEST_ARGS -L tests_fn -j1 CACHE STRING "Parameters to the test command.")
set(GCOVR_ADDITIONAL_ARGS
--exclude-noncode-lines
--exclude-unreachable-branches
--exclude-throw-branches
--print-summary
--gcov-ignore-errors=no_working_dir_found)
setup_target_for_coverage_gcovr(
NAME coverage
FORMAT ${CODE_COVERAGE_FORMAT}
EXECUTABLE ${CODE_COVERAGE_TEST}
EXECUTABLE_ARGS ${CODE_COVERAGE_TEST_ARGS}
EXCLUDE "tests" "examples"
DEPENDENCIES all
)
append_coverage_compiler_flags()