HomeClusterLabs Projects

Build: Add a coverage makefile target.

Description

Build: Add a coverage makefile target.

The purpose of this is to generate a code coverage report for what we
unit test. You need gcovr installed, but we could probably easily
convert to another tool.

Before doing this, you will need to use ./configure --with-coverage.

The gcda files are run by anything that gets executed. We execute
various tools in the build process (at least, all the command line tools
get run via help2man to generate their man pages), so the rm is to clear
all those out so "make check" starts with a clean slate.

There are a couple problems with this right now that I think are gcovr
bugs, but could be with how we are invoking it. First, it seems to have
trouble with any of our include files that are given in brackets. These
show up multiple times in the reports - strings_internal.h is listed as
a member of pretty much every directory, for instance. Second, files
may show up as duplicates in both their actual location and under
.libs/.

These problems prevent you from generating a detailed report which would
show exactly which lines are covered and which are not. Still, our
coverage is so low at this point that it seems unlikely we care to that
degree. Generating the report is optional and could still be
interesting for some reason.

Details

Provenance
clumensAuthored on May 27 2021, 11:50 AM
Parents
rPcd98d7575781: Build: Don't run "make check" in the doc and extra subdirs.
Branches
Unknown
Tags
Unknown

Event Timeline