From: W. Trevor King Date: Thu, 17 May 2012 12:40:38 +0000 (-0400) Subject: Add notes on calculating test coverage for Kerberos. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ea6b9572d57034bd79fea70e90c5d38385dd2667;p=blog.git Add notes on calculating test coverage for Kerberos. --- diff --git a/posts/Kerberos.mdwn b/posts/Kerberos.mdwn index abcdd7a..d88f77f 100644 --- a/posts/Kerberos.mdwn +++ b/posts/Kerberos.mdwn @@ -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]]