Sometimes it can be helpful to generally use branch coverage but to disable it
for some lines of code without excluding the line or function coverage too.
For example if you make heavily use of assertions in your code (which is
generally a good idea) you will see that for each 'assert(...)' exist one
branch which is taken and one that is not. Similarly you can see the same
phenomenon for 'delete' in C++ code.
If you use the 'LCOV_EXCL_LINE' marker in such a situation both of these
branches will be omitted from the output. But in doing so, you loose the
ability to determine if this peace of code is genuine 'dead code' or not
because the line coverage is omitted too.
The newly introduced 'LCOV_EXCL_BRANCH', 'LCOV_EXCL_BR_START' and
'LCOV_EXCL_BR_STOP' marker address this problem. The usage is similar to the
'LCOV_EXCL_LINE' etc. markers.
Attached you will find a patch to introduce this markers.
Apply the patch to the most current version of geninfo and its manpage
(commit: geninfo: fix --no-external not working with --initial (2013-08-02 07:29:20 +0000))
Feature added to the LCOV CVS repository.