Coverage support: build with --enable-coverage to have tests run with gcov

If you pass the --enable-coverage flag on the command line, we build
our testing binaries with appropriate options eo enable coverage
testing.  We also build a "tor-cov" binary that has coverage enabled,
for integration tests.

On recent OSX versions, test coverage only works with clang, not gcc.
So we warn about that.

Also add a contrib/coverage script to actually run gcov with the
appropriate options to generate useful .gcov files.  (Thanks to
automake, the .o files will not have the names that gcov expects to
find.)

Also, remove generated gcda and gcno files on clean.
This commit is contained in:
Nick Mathewson
2013-07-09 12:37:11 -04:00
parent a3e0a87d95
commit 17e9fc09c3
8 changed files with 61 additions and 2 deletions
+2
View File
@@ -31,6 +31,8 @@ src_test_test_SOURCES = \
src/test/test_config.c \
src/ext/tinytest.c
src_test_test_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
src_test_test_CPPFLAGS= $(src_test_AM_CPPFLAGS)
src_test_bench_SOURCES = \