Avoid recursive make for code coverage.
authorJelmer Vernooij <jelmer@samba.org>
Thu, 17 Apr 2008 00:06:07 +0000 (02:06 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Thu, 17 Apr 2008 00:06:07 +0000 (02:06 +0200)
(This used to be commit 2d1ca8cb7a1c39894e5f232f7e84936e6e1830ee)

source4/torture/config.mk

index 6e1bacf1990baf058ea2ad46e9797855361338ae..c2ec7c573a77da6b534ae58b94b6d44d7945a4c4 100644 (file)
@@ -313,28 +313,31 @@ locktest_OBJ_FILES = torture/locktest.o
 
 MANPAGES += torture/man/locktest.1
 
-COV_TARGET = test
+ifeq ($(MAKECMDGOALS),gcov)
+GCOV?=1
+endif
+
+ifeq ($(MAKECMDGOALS),lcov)
+GCOV?=1
+endif
 
-COV_VARS = \
-       CFLAGS="$(CFLAGS) --coverage" \
-       LDFLAGS="$(LDFLAGS) --coverage"
+ifeq ($(MAKECMDGOALS),testcov-html)
+GCOV?=1
+endif
 
-test_cov:
-       -$(MAKE) $(COV_TARGET) $(COV_VARS)
+ifdef GCOV
+CFLAGS += --coverage
+LDFLAGS += --coverage
+endif
+
+COV_TARGET = test
 
-gcov: test_cov
+gcov: test
        for I in $(sort $(dir $(ALL_OBJS))); \
                do $(GCOV) -p -o $$I $$I/*.c; \
        done
 
-lcov-split: 
-       rm -f samba.info
-       @$(MAKE) $(COV_TARGET) $(COV_VARS) \
-               TEST_OPTIONS="--analyse-cmd=\"lcov --base-directory `pwd` --directory . --capture --output-file samba.info -t\""
-       -rm heimdal/lib/*/{lex,parse}.{gcda,gcno}
-       genhtml -o coverage samba.info
-
-lcov: test_cov
+lcov: test
        -rm heimdal/lib/*/{lex,parse}.{gcda,gcno}
        lcov --base-directory `pwd` --directory . --capture --output-file samba.info
        genhtml -o coverage samba.info