Page MenuHome GnuPG

tests: Allow generating coverage info.

Authored by kai on Jun 8 2017, 7:13 PM.


Test Plan
  • install lcov
  • ./configure /*...*/ --enable-gcov
  • make coverage-html
  • xdg-open coveragereport/index.html

Diff Detail

rK libksba
No Linters Available
No Unit Test Coverage

Event Timeline

Thanks for working on that.

Given that we are preparing final releases, better do real test in private branches (kai/master or km/master) for now.

This looks like a lot of boilerplate code. It is okay to test this in libksba but when we come to the point touse this with more packages I would suggest to do this as a shell script. Our ./ is already the common denominator of all configure stuff. Adding a mode there to enable coverage reports and to use it as a helper script for Makefiles (iff needed) will make things much easier to maintain and keep consistend between packages. The generic source is in libgpg-error.

53 ↗(On Diff #1280)

FWIW, Maintaining such files in all packages is a pita. We should either replace that by a link or point to the README.GIT in libgpg-error, which is the dependency of all our packages (except for the very special nPth)

I'd suggest to that only in maintainer mode.

kai planned changes to this revision.Jun 9 2017, 7:20 PM

I didn't realize that we have a release coming up. Makes sense to postpone putting the changes into master until we're sure it doesn't break the build. Thanks for the review!

I'll try to integrate that into gcov.m4. The problem is that the boilerplate is project specific b/c it's excluding things like tests and utility functions from the coverage.

53 ↗(On Diff #1280)

How about adding it to HACKING in gnupg?

53 ↗(On Diff #1280)

Actually there is another task. We should move away from the distributed gnupg/doc/HACKING as primary source to the gnupg-doc/web/faq/ (or we even move from faq/ to the new devel/)

We can more easily update the web page so that new hackers get the latest info and not those from some distributed tarball. gnupg would then distribute a copy retrieved using the "make distcheck".

Generate coverage information.

  • add options --coverage and --report to help w/ coverage info collection and reporting.
  • m4/gcov.m4: new file. Boilerplate for locating gcov
  • add coverage-html target

GnuPG-Bud-Id: 3050
Test Plan:
./configure --enable-maintainer-mode --enable-gcov

make coverage-html

To measure test coverage gcov and lcov needs to be installed and
./configure called w/ --enable-gcov. The coverage-html make target will
then create a HTML report.

kai marked 3 inline comments as done.Aug 10 2017, 3:39 PM

Most of the boilerplate was moved to

Cool. I tested building without and with coverage report enabled.

This revision is now accepted and ready to land.Aug 10 2017, 3:53 PM
This revision was automatically updated to reflect the committed changes.