Reputation: 11
We are observing incorrect code coverage of C++ project on every run (Linux, Gcovr). Please find below our observations:
Also, there is a difference in the number of lines and branches in the total count highlighted in the attached pictures.
As per our understanding the total number of lines and branches should be constant because they are calculated at the compilation time (flag used -fPIC -fprofile-arcs -ftest-coverage) and should be in gcno files. Please correct, if our understanding is wrong.
Why there is a difference in the total number of lines and branches count?
If all the binaries are getting generated and all the testcases are successfully executed. What could be cause of incorrect code coverage of few files only every time?
How we can correct our code coverage?
Note: Its a C++ client project. We checked the behavior with other projects also but out of 6 projects, 4 projects are working fine with no code coverage issues.
Upvotes: 0
Views: 75