From: Tobias Brunner Date: Fri, 10 Jan 2025 16:23:19 +0000 (+0100) Subject: coverage: Exclude generated static proposal keywords X-Git-Tag: android-2.5.3~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7af260a5f1783fd155d87c2205009a4d4a18dfb2;p=thirdparty%2Fstrongswan.git 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. --- 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 \