From ac04f17db8a372a02dc5283cf40dda51638395f7 Mon Sep 17 00:00:00 2001 From: Jordan Bayles Date: Mon, 2 Feb 2026 12:41:17 -0800 Subject: [PATCH] Add gcovr.cfg to fix CI coverage merge errors 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. --- gcovr.cfg | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 gcovr.cfg diff --git a/gcovr.cfg b/gcovr.cfg new file mode 100644 index 000000000..ffbea3656 --- /dev/null +++ b/gcovr.cfg @@ -0,0 +1,22 @@ +# Newer versions of gcovr have strict function merging by default, which +# can cause issues with header-only functions or macros (like in jsontest.h). +# 'separate' mode keeps them distinct, fixing the GcovrMergeAssertionError. +merge-mode-functions = separate + +# --- Filtering --- +# Only include the library sources in the coverage report. +# This ensures coverage stats reflect the library quality and ignores test code. +filter = src/lib_json/ +filter = include/json/ + +# Exclude the build directory to avoid processing generated files +exclude-directories = build + +# --- Noise Reduction --- +# Ignore branches that are generated by the compiler (e.g., exception handling) +# This drastically reduces "false positives" for missing branch coverage. +exclude-throw-branches = yes + +# --- CI Visibility --- +# Print a small summary table to the console logs. +print-summary = yes