aboutsummaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-07-09 12:37:11 -0400
committerNick Mathewson <nickm@torproject.org>2013-07-10 15:22:16 -0400
commit17e9fc09c31dffdc647385220a14daef5a35273a (patch)
tree66b1a0ccb2e176bc2646a25cdd03fd6eb0d90435 /Makefile.am
parenta3e0a87d951b1323ca542c9b115d5525d0d022c9 (diff)
downloadtor-17e9fc09c31dffdc647385220a14daef5a35273a.tar
tor-17e9fc09c31dffdc647385220a14daef5a35273a.tar.gz
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.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index a736638e4..1bc1077eb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -32,6 +32,12 @@ EXTRA_DIST+= \
README \
ReleaseNotes
+if COVERAGE_ENABLED
+TEST_CFLAGS=-fno-inline -fprofile-arcs -ftest-coverage
+else
+TEST_CFLAGS=
+endif
+
#install-data-local:
# $(INSTALL) -m 755 -d $(LOCALSTATEDIR)/lib/tor
@@ -89,3 +95,5 @@ version:
(cd "$(top_srcdir)" && git rev-parse --short=16 HEAD); \
fi
+mostlyclean-local:
+ rm -f src/*/*.gc{da,no}