
On Thu, Aug 24, 2006 at 02:07:51PM +0100, Daniel P. Berrange wrote:
Quite a critical bit of the libvirt code is that which converts between SEXPR and XML, and vica-verca. I've broken this code several times when making changes, so it is way overdue to get some unit test coverage in this area.
Having added some unit test coverage, I was wondering just how *much* coverage... So I've attached another patch which adds a new flag to configure - --enable-test-coverage, which causes everything to be compiled & linked with -fprofile-arcs -ftest-coverage There is then a 'make cov' target in the top level directory which genrates an HTML report showing code coverage: http://people.redhat.com/berrange/libvirt-coverage/ Obviously it is mostly red - my goal is not to get 100% coverage - clearly thats impossible in unit tests, since most of the XenD interaction can only be tested through integration tests. It is however useful to be able to view how much of the XML<->SEXPR routines are covered, since they're easily unit testable. Also coverage on 'virsh' is useful since we can run it with the test backend instead of xen. The reports are generated using Perl & xsltproc - yes, this adds Perl as a dependancy, but I don't think its a worry, because this is totally a no-op unless you explicitly pass --enable-test-coverage to configure, so won't impact normal 'configure; make ; make install' cycle done by most developers. Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|