Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Branch coverage is reported wrongly #105
In some cases you might have 0 branches in all files. In that case branch coverage is reported differently in a HTML report:
It looks like 0% value is selected to avoid the zero division. An extra check could be added to show a proper statistics information.
Tested with official gcovr 3.2 release.
I can confirm the different behaviour.
The calculation for the branch coverage for the coverage report is:
But for the module the coverage is calculated as follows:
@mayeut That looks like a reasonable approach to visualize this case. If you already have a PR ready do submit it please. I would have otherwise deferred this issue until after some improvements from the dev branch have been backported (refactoring into multiple files, and template-based HTML reports).