BullseyeCoverage Up Contents Search

Merge Result Has Lower Coverage Than Some Inputs

The result of merging coverage files produced from instrumenting different versions of a project may result in coverage levels that are lower than appear in some of the individual input coverage files. This occurs when the source code of a function is modified and there are different versions of the function in different coverage files and the newest version of the function has less coverage than the older versions. When the merging process encounters more than one version of a function, the measurements for the newest version of the function are retained while the older functions are discarded. The merge result is correct.

The determination of whether a function has been modified is based on the source code of the function. The determination is not affected by macros that expand differently, nor is it affected by differing results of conditional compilation directives, such as #if.

You can use the covmgr command with options --list --verbose --function to see details of whether functions differ. The Id field identifies a version of a function. In the example output below, the function function1() is the same in the two coverage files, while function2() differs.

covmgr --file test1.cov --list --verbose --function

Id        Version  Modify Time          Name
--------  -------  -------------------  ------
a1771728  8.23.8   2021-09-07 10:14:06  cov/example.obj
be6e2799           2021-09-07 09:11:22  cov/example.cpp
36221306                                function1(int)
129c4b0a                                function2(int)
covmgr --file test2.cov --list --verbose --function

Id        Version  Modify Time          Name
--------  -------  -------------------  ------
a1599ac3  8.23.8   2021-09-07 10:15:39  cov/example.obj
17433bd5           2021-09-07 10:15:24  cov/example.cpp
36221306                                function1(int)
d6f75380                                function2(int)

Updated: 7 Sep 2021