build: Add an --enable-code-coverage configure parameter
authorPhilip Withnall <philip@tecnocode.co.uk>
Sun, 8 Jan 2012 15:58:16 +0000 (15:58 +0000)
committerPhilip Withnall <philip@tecnocode.co.uk>
Sun, 8 Jan 2012 21:49:40 +0000 (21:49 +0000)
commit945cb3d7301b94205ad77fb454482d07679f5037
treea0e7c9e7bd6f0c5fe005f5128b6747e27d5a6335
parentf4b46b0cdbea0ef334ffc1fe281440654c40dfea
build: Add an --enable-code-coverage configure parameter

When building with code coverage enabled, -fprofile-arcs and -ftest-coverage
will be passed to gcc during compilation, and -lgcov will be passed during
linking.

Code coverage is disabled by default for the core of folks, since it has to
turn off valac’s ‘-g’ option to output #line directives in the generated C
code. This is necessary because lcov gets confused by execution passing
between .vala and .c files. More useful results can be obtained by just
looking at the code coverage of the .c files and ignoring the boilerplate
in them.

(More specifically, lcov reports on .vala files aren’t especially useful
because they erroneously mark many lines as being executed which actually
weren’t. This happens because one Vala line may be compiled into several
lines of C, some of which will be executed unconditionally even if the Vala
line itself isn’t executed. This will fool lcov into thinking the Vala line
was actually executed.)

Code coverage is automatically turned off when making a release.
backends/eds/Makefile.am
backends/eds/lib/Makefile.am
backends/key-file/Makefile.am
backends/libsocialweb/Makefile.am
backends/libsocialweb/lib/Makefile.am
backends/telepathy/Makefile.am
backends/telepathy/lib/Makefile.am
backends/tracker/Makefile.am
backends/tracker/lib/Makefile.am
configure.ac
folks/Makefile.am