Reputation: 28545
The latest version of genhtml provides a differential coverage report. ie it can tell you stats like if code in the previous version that was "covered" is now "uncovered" and vice versa. To make this work, you need to pass a baseline coverage file to genhtml
that tells it the current state of coverage of your codebase. When someone adds a new commit to your codebase, genhtml
uses the baseline file and the current state of coverage to give you differential stats like the one I mentioned above.
But once new changes have been added to the codebase, the baseline file is now stale and needs to be updated to the latest coverage state of the codebase. As you can see, you need to do this every time new code changes are made.
I don't want developers to be bothered by updating this baseline file every time they make new changes. I am thinking of automating updating of the baseline file via Github actions once every week or so. But wanted to see if someone has a better idea or does genhtml
itself has a mechanism to avoid having to update the baseline file on every code change.
Upvotes: 0
Views: 158
Reputation: 91
One way to do what I think you want is to use Jenkins (or your regression system of choice):
genhtml --baseline-file
parameter.gentml --criteria-script ...
option to specify your coverage criteria (e.g., no un-exercised new code, no losses, etc.). genhtml will return a non-zero exit status if your criteria fails. See the man pages and the sample scripts, for details.Note that you almost certainly need a 'signoff' mechanism to deal with the (hopefully) rare case that you want to accept a commit when doesn't meet your criteria.
The above is called a 'coverage ratchet' in the paper referred in the LCOV readme.
Upvotes: 0