diff options
-rw-r--r-- | source4/torture/config.mk | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/source4/torture/config.mk b/source4/torture/config.mk index 6e1bacf199..c2ec7c573a 100644 --- a/source4/torture/config.mk +++ b/source4/torture/config.mk @@ -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 |