Testing and gcov

Dan Nicholson dbn.lists at gmail.com
Wed Oct 3 05:45:32 PDT 2012


Last week I added optional use of gcov to see how much test coverage
our code was getting. The initial results weren't as bad as I
expected, but I added a bunch more tests to exercise more of the code.
Some tests are for features which had never been touched in the
testsuite at all, like SYSROOT_DIR and uninstalled handling. In the
process I even found a bunch of dead code that had been there since
the initial port to C but never used as far as I could tell. Now the
story looks a lot better from gcov. From "./configure --with-gcov &&
make gcov":

/usr/bin/gcov pkg.h pkg.c parse.h parse.c main.c
File 'pkg.c'
Lines executed:87.12% of 559
pkg.c:creating 'pkg.c.gcov'

File '/usr/include/glib-2.0/glib/gstring.h'
Lines executed:100.00% of 6
/usr/include/glib-2.0/glib/gstring.h:creating 'gstring.h.gcov'

File 'parse.c'
Lines executed:82.11% of 492
parse.c:creating 'parse.c.gcov'

File 'main.c'
Lines executed:91.13% of 293
main.c:creating 'main.c.gcov'

For some reason, it insists on checking gstring.h, and I haven't
bothered to figure out why yet. Anyway, if you can run "make check" on
master and see if the tests still pass for you, that would be helpful.
Especially on Windows where we have some different pathways.

Thanks!

--
Dan


More information about the pkg-config mailing list