coverage: exclude system files (gcc, catch, ..)

This commit is contained in:
Roland Conybeare 2023-09-20 17:13:02 -04:00
commit 78eceaab42
2 changed files with 7 additions and 1 deletions

View file

@ -9,7 +9,13 @@ include(cmake/code-coverage.cmake)
enable_testing()
# activate code coverage for all executables + libraries (when -DCODE_COVERAGE=ON ??)
add_code_coverage()
add_code_coverage_all_targets()
# 1. assuming that /nix/store/ prefixes .hpp files belonging to gcc, catch2 etc.
# we're not interested in code coverage for these sources.
# 2. exclude the utest/ subdir, we don't need coverage on the unit tests themselves;
# rather, want coverage on the code that the unit tests exercise.
#
add_code_coverage_all_targets(EXCLUDE /nix/store/* utest/*)
# always write compile_commands.json
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Before After
Before After