cURL / Mailing Lists / curl-library / Single Mail


Re: curl test coverage report

From: Dan Fandrich <>
Date: Mon, 5 Mar 2007 09:22:56 -0800

On Sat, Mar 03, 2007 at 10:33:49PM +0100, Daniel Stenberg wrote:
> Anyway, can you reproduce this report with a script or similar on demand? I
> hope to be able to use that list as input and write up a few new test cases
> to test more code, and it then it would be nice to see that the additions
> actually have an effect on the coverage.

I used the GUI-based ggcov to generate the reports, but most of the data
can be extracted from its command-line cousin gcov. To get those reports,
I configured curl with:

  ./configure CFLAGS='-fprofile-arcs -ftest-coverage -g -O0' --disable-shared

then a plain 'make'. You should be able to do a plain 'make test' to run it,
but I did:

  cd tests; make full-test TEST_F='-a -p -n'

to avoid running valgrind at the same time. Then:

  ggcov -r lib src

to run ggcov on the results. There's a reports window for looking at the
summary reports. gcov doesn't seem to want to load objects from more
than one directory at a time, so you may need to give it some coaxing.

Two points to keep in mind: make sure to disable ccache if you have it
turned on by default, and don't try to build curl outside the source
directory (using gmake's VPATH feature). After much head scratching, I
discovered both those feature mess up gcov/ggcov's source path searching

>>> Dan

--              The web change of address service
          Let webmasters know that your web site has moved
Received on 2007-03-05