]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
coverage: Exclude generated static proposal keywords
authorTobias Brunner <tobias@strongswan.org>
Fri, 10 Jan 2025 16:23:19 +0000 (17:23 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 10 Jan 2025 17:53:57 +0000 (18:53 +0100)
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

index 762a51c140ada38946f33cc018523ec1f0e79732..bbae039f59e570e0ff6920f7b01415cba99c806a 100644 (file)
@@ -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 \