Test suite code coverage reports

Daniel P. Berrange dan at berrange.com
Wed May 10 09:13:36 PDT 2006

On Wed, May 10, 2006 at 11:16:36AM -0400, Havoc Pennington wrote:
> Daniel P. Berrange wrote:
> >Both have pretty impressively high test coverage - great job by all those
> >responsible for writing test cases!
> For the bulk of dbus's lifetime I used to have a working "make 
> coverage-report" that would in one step run the build, run make check, 
> and then dump out reports much like these you have here (total and file 
> percentages, and then line-by-line annotated source).

Yeha, I tried to run the tools there already but they just segfaulted
on me, so I assume the gcov file format changed. I also needed to doing
some Makefile.am hacking because libtool strips out the -fprofile-arcs
and -ftest-coverage options when linking - need to prefix them with -Wc,

> Do you think we could put these into the dbus tree instead of my old C 
> version that fell behind gcov, and get "make coverage-report" working 
> again? Having it in perl is fine, it's not a required dependency of 
> anything and about everyone with gcc/gcov is going to have perl too.

Sure, I'll take a look at hooking them into the makefiles sometime in
the next week or so.

> One thing I had in the old tool was that it didn't include lines of code 
> (and basic blocks) inside #ifdef DBUS_BUILD_TESTS in the statistics, 
> without that fix you can't get to 100% coverage due to code like:
>  if (!run_test())
>    die("test failed"); // test suite does not cover this line!

It ought to be possible to filter out those from the coverage reports
without too much trouble.

|=-            GPG key: http://www.berrange.com/~dan/gpgkey.txt       -=|
|=-       Perl modules: http://search.cpan.org/~danberr/              -=|
|=-           Projects: http://freshmeat.net/~danielpb/               -=|
|=-   berrange at redhat.com  -  Daniel Berrange  -  dan at berrange.com    -=|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060510/e0184dd0/attachment.pgp

More information about the dbus mailing list