[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Generating code coverage reports
From: |
Ralf Wildenhues |
Subject: |
Re: Generating code coverage reports |
Date: |
Tue, 28 Oct 2008 18:20:35 +0100 |
User-agent: |
Mutt/1.5.17+20080114 (2008-01-14) |
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). [...]
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).
Cheers,
Ralf