From: Peter Oberparleiter <oberparleiter@go...> - 2007-11-05 14:38:50
Verweij, Arjen wrote:
> sx104_137: pwd
> -rw-rw---- 1 verweija mad 0 Sep 27 16:02
If code is generated for this source code file then this looks like a bug in gcc.
> The runs I did with 1.5 that yielded coverage reports just fine also had
> these files with 0 bytes.
I would assume that those files where simply ignored and there is no coverage information in the final output for them.
> I'll see about trying another compiler. Are there any others you
> recommend? Can I also try gcc4.x.y?
Anything more recent is more likely to work. New lcov development like the -i switch is tested best on the most recent compiler versions (i.e. gcc4.x).
> Could you also please comment on how lcov ascertains the number of
> Instrumented lines? This number seems to vary with the extend of the
> test suite.
When used without the -i switch, lcov will only include data (both # of lines covered and instrumented) for files which contains code that was actually executed. This results in more instrumented lines as more test cases are performed.
Using the -i switch lcov collects data for all files for which coverage support was specified while compiling. So if you want to have consistent coverage percentage values you should initially use the -i switch to collect a "baseline" coverage file and then combine that file with the actual coverage data for a test case using lcov -a.
Apart from that the number of instrumented lines may change when modifying the source code or the means of compilation (compiler version, flags, etc.).