Problem with LCOV GCOV
I am getting code coverage statistics with for one of my small library's that I'm currently testing. However, I'm getting a few odd results, lines that I know are being covered are not being counted, Other lines are being missed, until I cover them.
For lines being covered but missed see lines 63, 83, 96 & 113 For lines being missed see line 342 My library of routines is written in C++ and uses many QT routines. I have compiled with and without optimisation and of course I include the flags -fprofile-arcs -ftest-coverage when both compiling and linking. my commands to lcov are as follows: Code:
lcov -z -d object/ -q My question: Is this something that I have to live with or is there a work around? |
Typical, five minutes after posting my question I find the answer... At least for the lines being covered but missed. It's due to optimisation of the implied copy constructor. If I compile with -fno-elide-constructors it works as hoped.
I think that the other problem is due to the inlining of the code and that I can live with. |
All times are GMT -5. The time now is 05:20 AM. |