[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Generating code coverage reports
From: |
Ludovic Courtès |
Subject: |
Re: Generating code coverage reports |
Date: |
Tue, 28 Oct 2008 19:10:52 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) |
Hi Ralf,
Ralf Wildenhues <address@hidden> writes:
> Hello Ludovic, Simon,
>
> * Ludovic Courtès wrote on Tue, Oct 28, 2008 at 05:48:12PM CET:
>>
>> Let me explain this. Suppose you have tests T1 and T2:
>>
>> * T1 uses code from foo.c and t1.c;
>> * T2 uses code from foo.c and t2.c.
>>
>> Running "make check" runs T1, then T2:
>>
>> * T1 is run, producing foo.gcda and t1.gcda;
>> * T2 is run, *overriding* foo.gcda and producing t2.gcda.
>>
>> In the end, `lcov' is fed with foo.gcda from the T2 run, whereas what we
>> really want to have is the code covered in foo.c by T1 *and* T2.
>
> That's not what my GCC documentation says (info gcc 'Invoking Gcov',
> near the end):
>
> The execution counts are cumulative. If the example program were
> executed again without removing the `.gcda' file, the count for the
> number of times each line in the source was executed would be added to
> the results of the previous run(s). [...]
Oh, you're right. The GCC 4.2 manual contains the same paragaph:
http://gcc.gnu.org/onlinedocs/gcc-4.2.4/gcc/Invoking-Gcov.html#Invoking-Gcov .
Sorry for the confusion.
> FWIW, IIRC then the directory handling of the files was only fixed to be
> sane rather recently in the GCC tree (I guess 4.4 only).
By "directory handling", you mean the location where GCDA files are
produced relative to the location of the corresponding `.o' files?
Thanks,
Ludo'.