Set option to calculate coverage as (h + p) / (h + p + m)

Language C++


I have a project that uses macros that show up as partial hits on execution. I like the idea of including branching information, but it creates a -10% coverage difference. Ideally, I’d like to refer to my branch information, but don’t want to take the coverage hit.

Could you add a flag that lets us calculate coverage as (h + p) / (h + p + m) instead of h / (h + p + m)?


Hey @madisetti,

We have this feature out of the box for our Javascript parser. We also have the option to enable branches (e.g., partials) on our GCOV parser:

      conditional: yes
      loop: yes
      method: no
      macro: no 

Would this help you in your C++ code coverage generation?


Thanks Jerrod,

I’m using lcov- and it would seem that these flags don’t apply. Here’s an example of a block I would expect to be totally green:


I don’t mind the branching highlights since they are useful for if statements etc… but the current calculation is the difference from me reporting ~90% test coverage to high 60s.

Proposed feature is more of a catch all for various reports, but I understand if it’s a wont-fix

Hi @madisetti, totally understand and sorry that this slipped past getting a timely response. Unfortunately, we don’t expect to make this fix in the near future, but our product team is aware that this has been requested from you. We’ll keep this in mind for the future.

Let me know if there’s anything else we can do to help you!