gcov/lcov problems with branch coverage and c++

Sven Eppler sven@sveneppler.de
Thu Feb 2 14:00:00 GMT 2017


Hello,
we are using GCOV/LCOV to produce test coverage for our projects.
Recently we tried to enable branch-coverage additionally.
But it looks like, this just doesn't yield the results we expected from 
a high level developer view.

Using branch-coverage with C++ blows the report up with branches all 
over the place.
We suspect (as the searching for the issues indicates) that mostly 
exception handling code
creates these "hidden branches". And GCOV/LCOV doesn't seem to skip over 
these.

I created a small test project to show the problem:

    https://github.com/ghandmann/lcov-branch-coverage-weirdness

Currently we use Ubuntu 16.04. with:
  - gcc v5.4
  - lcov & genhtml v1.12

Our production code is build with c++11 enabled. The minimal example 
isn't build with c++11 enabled,
but as we experimented a bit with all different options (c++ standard, 
optimization, -fno-exceptions)
we didn't came up with a passable result.

Anybody got some ideas? Hints? Are we using anything the wrong way?
Is this - as stated somewhere else - really expected behavior?

Thanks four your time!

Best regards
Sven

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4289 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20170202/d0ed8bbf/attachment.p7s>


More information about the Gcc-help mailing list