Skip to content

Commit e799ca0

Browse files
authored
Add gcovr.cfg to fix CI coverage merge errors (#1635)
Configures gcovr to use 'merge-mode-functions = separate', resolving the GcovrMergeAssertionError caused by strict merging of header-only functions in `jsontest.h`. Also adds source filtering to focus reports on `src/lib_json/` and `include/json/`, and excludes throw branches to reduce false positives.
1 parent 32f924f commit e799ca0

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

gcovr.cfg

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Newer versions of gcovr have strict function merging by default, which
2+
# can cause issues with header-only functions or macros (like in jsontest.h).
3+
# 'separate' mode keeps them distinct, fixing the GcovrMergeAssertionError.
4+
merge-mode-functions = separate
5+
6+
# --- Filtering ---
7+
# Only include the library sources in the coverage report.
8+
# This ensures coverage stats reflect the library quality and ignores test code.
9+
filter = src/lib_json/
10+
filter = include/json/
11+
12+
# Exclude the build directory to avoid processing generated files
13+
exclude-directories = build
14+
15+
# --- Noise Reduction ---
16+
# Ignore branches that are generated by the compiler (e.g., exception handling)
17+
# This drastically reduces "false positives" for missing branch coverage.
18+
exclude-throw-branches = yes
19+
20+
# --- CI Visibility ---
21+
# Print a small summary table to the console logs.
22+
print-summary = yes

0 commit comments

Comments
 (0)