Add notes on calculating test coverage for Kerberos.
authorW. Trevor King <wking@tremily.us>
Thu, 17 May 2012 12:40:38 +0000 (08:40 -0400)
committerW. Trevor King <wking@tremily.us>
Thu, 17 May 2012 12:40:38 +0000 (08:40 -0400)
posts/Kerberos.mdwn

index abcdd7ab8212950f5071085b367b3dc0c310fee7..d88f77fd2552cd6353f9cf8fbae705bd56fccd2a 100644 (file)
@@ -323,6 +323,26 @@ user access to the NFS-mounted music as the `nobody` principal.
 
 For debugging, check out the [KRB5_TRACE][] environment variable.
 
+If you end up compiling from source, you can run the [unit
+tests][test] and [check coverage][gcov] with something like:
+
+    $ git clone 
+    $ cd krb5/src
+    $ util/reconf
+    $ mkdir ../build
+    $ cd ../build
+    $ ../src/configure --disable-rpath CFLAGS="-fprofile-arcs -ftest-coverage -O0" LIBS=-lgcov
+    $ make
+    $ make check
+    $ cd lib/krb5/os
+    $ gcov -o sn2princ.so.gcno ../../../lib/krb5/os/sn2princ.c
+    $ gcov -o sn2princ.so.gcno sn2princ.c
+    $ less sn2princ.c.gcov
+
+Running `configure` from a separate directory creates a [VPATH][]
+build, which avoids polluting the source directory with generated
+files.
+
 [Kerberos]: http://web.mit.edu/kerberos/
 [install]: http://web.mit.edu/kerberos/krb5-1.9/krb5-1.9.1/doc/krb5-install.html
 [DNS]: http://web.mit.edu/kerberos/krb5-1.9/krb5-1.9.1/doc/krb5-admin.html#Using%20DNS
@@ -347,6 +367,9 @@ For debugging, check out the [KRB5_TRACE][] environment variable.
 [ssh]: http://docstore.mik.ua/orelly/networking_2ndEd/ssh/ch11_04.htm
 [apps]: http://web.mit.edu/kerberos/krb5-1.9/krb5-1.9.1/doc/krb5-user.html#Kerberos%20V5%20Applications
 [KRB5_TRACE]: http://web.mit.edu/kerberos/krb5-current/doc/krb_admins/env_variables.html
+[test]: http://web.mit.edu/kerberos/krb5-current/doc/krb_build/doing_build.html#testing-the-build
+[gcov]: http://web.mit.edu/kerberos/krb5-current/doc/krb_build/test_cov.html
+[VPATH]: http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Make-Target-Lookup.html
 
 [[!tag tags/linux]]
 [[!tag tags/tools]]