From 7af260a5f1783fd155d87c2205009a4d4a18dfb2 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 10 Jan 2025 17:23:19 +0100 Subject: [PATCH] coverage: Exclude generated static proposal keywords The lines in the gperf-generated proposal_keywords_static.c are now mapped to the (much shorter) .txt source file, which causes mismatches like these: genhtml: ERROR: no data for line:190, TLA:GNC, file:/home/runner/work/strongswan/strongswan/src/libstrongswan/crypto/proposal/proposal_keywords_static.txt We could ignore "unmapped" errors in genhtml, but since the file is generated anyway, we can also exclude it from the results and still get such errors in case this happens for other files. Another alternative would be to remove the `#line` macros in the generated file. Then the coverage of the actual C file would get reported (but again, it's generated, so there isn't much value in it). Also updated the branch coverage option as the one with `lcov_` prefix is deprecated. --- Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 762a51c140..bbae039f59 100644 --- a/Makefile.am +++ b/Makefile.am @@ -65,10 +65,11 @@ cov-reset: cov-reset-common cov-report: @mkdir $(top_builddir)/coverage lcov -c -o $(top_builddir)/coverage/coverage.info -d $(top_builddir) \ - --rc lcov_branch_coverage=1 + --rc branch_coverage=1 lcov -r $(top_builddir)/coverage/coverage.info '*/tests/*' '*/suites/*' '/usr*' \ + '*proposal_keywords_static.*' \ -o $(abs_top_builddir)/coverage/coverage.cleaned.info \ - --rc lcov_branch_coverage=1 + --rc branch_coverage=1 genhtml --num-spaces 4 --legend --branch-coverage --ignore-errors source \ -t "$(PACKAGE_STRING)" \ -o $(top_builddir)/coverage/html \ -- 2.47.2