[libvirt] Switch to using lcov for test coverage reports

Jim Meyering jim at meyering.net
Fri May 23 15:38:57 UTC 2008


"Daniel P. Berrange" <berrange at redhat.com> wrote:
> I got fed up trying to figure out how to fix the coverage reports to merge
> data from multiple runs correctly, so this patch rips out all our test
> coverage support. In its place is a makefile rule which just calls out to
> the lcov program.  It requires lcov >= 1.6  since earlier versions were
> too dumb to deal with .libs/ directories properly.  This version has just
> been submitted to Fedora updates repos.
...
> diff -r ddd05d94cc2d Makefile.am
> --- a/Makefile.am	Thu May 22 17:13:05 2008 -0400
> +++ b/Makefile.am	Thu May 22 17:27:30 2008 -0400
...
> -cov: cov-recursive cov-am
> +cov: clean-cov
> +	mkdir $(top_builddir)/coverage
> +	$(LCOV) -c -o $(top_builddir)/coverage/libvirt.info.tmp -d $(top_srcdir)/src  -d $(top_srcdir)/qemud -d $(top_srcdir)/tests
> +	$(LCOV) -r $(top_builddir)/coverage/libvirt.info.tmp -o $(top_builddir)/coverage/libvirt.info *usr*
> +	rm $(top_builddir)/coverage/libvirt.info.tmp
> +	$(GENHTML) -s -t "libvirt" -o $(top_builddir)/coverage --legend $(top_builddir)/coverage/libvirt.info

Looks fine, modulo the too-long lines ;-)
It'd be nice to factor out the 5 uses of
`$(top_builddir)/coverage/libvirt.info'.

It's good to declare targets like "cov" to be "PHONY",
so that "make -t" doesn't create a "cov" file.

.PHONY: cov

ACK.




More information about the libvir-list mailing list