From fc383e025f09af70d3eb52fcd7e03c02733b14b0 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Fri, 8 Mar 2013 10:04:11 +0100 Subject: Document and put code coverage online * Document our testing practices * Put lcov code coverage output online --- Makefile.am | 16 ++++++++++++---- doc/p11-kit-devel.xml | 22 ++++++++++++++++++++++ 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 29aee65..e7d53f5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,7 @@ +WEBHOST = anarchy.freedesktop.org +WEBBASE = /srv/p11-glue.freedesktop.org/www + if WITH_TRUST_MODULE TRUST_DIR = trust else @@ -40,19 +43,24 @@ coverage: $(LCOV) --directory . --zerocounters $(MAKE) check $(LCOV) --directory . --capture --output-file build/coverage.info - $(GENHTML) --output-directory build/coverage build/coverage.info + $(GENHTML) --output-directory build/coverage \ + --title "p11-kit $(PACKAGE_VERSION)" \ + build/coverage.info @echo "file://$(abs_top_builddir)/build/coverage/index.html" + +upload-coverage: coverage + rsync -Hvax build/coverage/./ $(WEBHOST):$(WEBBASE)/build/coverage/./ endif if ENABLE_GTK_DOC upload-doc: all - rsync -Hvax --exclude doc \ - doc/html/./ anarchy.freedesktop.org:/srv/p11-glue.freedesktop.org/www/doc/p11-kit/./ + rsync -Hvax --exclude doc build \ + doc/html/./ $(WEBHOST):$(WEBBASE)/doc/p11-kit/./ endif upload-release: $(DIST_ARCHIVES) gpg --detach-sign --local-user 'stef@thewalter.net' $(DIST_ARCHIVES) - scp $(DIST_ARCHIVES) $(DIST_ARCHIVES).sig anarchy.freedesktop.org:/srv/p11-glue.freedesktop.org/www/releases/ + scp $(DIST_ARCHIVES) $(DIST_ARCHIVES).sig $(WEBHOST):$(WEBBASE)/releases/ EXTRA_DIST = \ config.rpath \ diff --git a/doc/p11-kit-devel.xml b/doc/p11-kit-devel.xml index af32c54..bbe6c0a 100644 --- a/doc/p11-kit-devel.xml +++ b/doc/p11-kit-devel.xml @@ -263,6 +263,28 @@ $ make install check for unexpected conditions. +
+ Testing and Code Coverage + + As a general rule changes to p11-kit should have a tests exercising + that change. Use the make check command to run all + the tests. If you run it from a subdirectory only the tests in that + directory will be run. + + Build p11-kit with the configure + option to build code coverage support. + + Once you've done that you can either use make coverage + to build code coverage information. Alternatively (and this is usually + easier) you can use + + git coverage to easily check whether + you've tested the lines changed by a patch. + + A code coverage report is + available online. +
+
Debugging Tips -- cgit v1.1