I've been trying to get which condition on a branch my executed test case took.
For example, this is a snip of the coverage information I got from Gcov's gcov -b
(I also use -i
option for readability):
lcount:10,1
branch:10,nottaken
branch:10,taken
After examining some samples, it seems that the true condition always written first on every branch information. Which means I can determine whether the executed test case take the true part or false part of the branch. And in this case, the test case took the false part of the branch on line 10.
Now, here is a snip from a generated xml by Gcovr's --branches
and --xml
of the same program and test case:
<line branch="true" condition-coverage="50% (1/2)" hits="1" number="10">
<conditions>
<condition coverage="50%" number="0" type="jump"/>
</conditions>
</line>
Here, I can't figure out which part of the branch was taken.
Is there any options on Gcovr that I can use?