Fix source filename handling when using --use-gcov-files #146
I've looked at this PR a couple of times and still don't understand it. There's a quite complicated test case for a change of three lines of code. While I'm sure this represents a good improvement, I'm not seeing the big picture here.
Could you give me an explanation on what the problem is, and how the test case represents this problem? It would be extremely helpful if you can walk me through the various file paths and what gcovr will do with them under your change. We can then later edit this explanation into a README for the test case.
Though not strictly required, I prefer to merge a change only if I understand what I'm doing :D
The new test
First a little sample of what happens without the patch.
As we can see, we're missing quite a bit of coverage information.
If we have a look at the verbose output for
We can see that
If we do that, here's the verbose output for that same file:
This time, the source filename is resolved correctly.
gcov documentation states that gcov should be run with the current directory the same as that when you invoked the compiler. It makes sense to handle source filename resolution using this information.