]> granicus.if.org Git - p11-kit/commitdiff
Document and put code coverage online
authorStef Walter <stefw@gnome.org>
Fri, 8 Mar 2013 09:04:11 +0000 (10:04 +0100)
committerStef Walter <stefw@gnome.org>
Fri, 8 Mar 2013 09:04:11 +0000 (10:04 +0100)
 * Document our testing practices
 * Put lcov code coverage output online

Makefile.am
doc/p11-kit-devel.xml

index 29aee65739625ac57f877998c643eb0bec8ad7b9..e7d53f5707ab51b0f238c9f040b30e51c9dd9434 100644 (file)
@@ -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 \
index af32c54dd87e63c25b444fdf809191c7db44448e..bbe6c0a434b6ee85590dac98e2da5474c6be71d0 100644 (file)
@@ -263,6 +263,28 @@ $ make install
                check for unexpected conditions.</para>
        </section>
 
+       <section id="devel-testing">
+               <title>Testing and Code Coverage</title>
+
+               <para>As a general rule changes to p11-kit should have a tests exercising
+               that change. Use the <literal>make check</literal> command to run all
+               the tests. If you run it from a subdirectory only the tests in that
+               directory will be run.</para>
+
+               <para>Build p11-kit with the <option>--enable-coverage</option> configure
+               option to build code coverage support.</para>
+
+               <para>Once you've done that you can either use <literal>make coverage</literal>
+               to build code coverage information. Alternatively (and this is usually
+               easier) you can use
+               <ulink url="http://stef.thewalter.net/2012/12/git-coverage-useful-code-coverage.html">
+                       <literal>git coverage</literal></ulink> to easily check whether
+               you've tested the lines changed by a patch.</para>
+
+               <para>A code coverage report is
+                       <ulink url="http://p11-glue.freedesktop.org/build/coverage">available online</ulink></para>.
+       </section>
+
        <section id="devel-debugging">
                <title>Debugging Tips</title>