aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-03-11 13:47:01 -0700
committerJunio C Hamano <gitster@pobox.com>2009-03-11 13:47:01 -0700
commite785dadc90df20e1038c053dc168a6458b1e672b (patch)
tree5c147998a1030a06155e64686229929db8fe1776 /Makefile
parent7d59ceed9d1e4f8f0dc52cebf55219d6d395c9da (diff)
parentb26d8d217d8d960cbd9ed1dbf6b3cccfd1a3a4db (diff)
downloadgit-e785dadc90df20e1038c053dc168a6458b1e672b.tar.gz
git-e785dadc90df20e1038c053dc168a6458b1e672b.tar.xz
Merge branch 'tr/gcov'
* tr/gcov: Test git-patch-id Test rev-list --parents/--children Test log --decorate Test fsck a bit harder Test log --graph Test diff --dirstat functionality Test that diff can read from stdin Support coverage testing with GCC/gcov
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 0675c43e7..1087884be 100644
--- a/Makefile
+++ b/Makefile
@@ -1640,3 +1640,27 @@ check-docs::
check-builtins::
./check-builtins.sh
+### Test suite coverage testing
+#
+.PHONY: coverage coverage-clean coverage-build coverage-report
+
+coverage:
+ $(MAKE) coverage-build
+ $(MAKE) coverage-report
+
+coverage-clean:
+ rm -f *.gcda *.gcno
+
+COVERAGE_CFLAGS = $(CFLAGS) -O0 -ftest-coverage -fprofile-arcs
+COVERAGE_LDFLAGS = $(CFLAGS) -O0 -lgcov
+
+coverage-build: coverage-clean
+ $(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" all
+ $(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \
+ -j1 test
+
+coverage-report:
+ gcov -b *.c
+ grep '^function.*called 0 ' *.c.gcov \
+ | sed -e 's/\([^:]*\)\.gcov: *function \([^ ]*\) called.*/\1: \2/' \
+ | tee coverage-untested-functions