Makefile: Add cover_db target
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sun, 25 Jul 2010 19:52:42 +0000 (19:52 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 18 Aug 2010 19:42:18 +0000 (12:42 -0700)
Add a target to convert the *.gcov files to a Devel::Cover
database. That database can subsequently be formatted by the cover(1)
tool which is included with Devel::Cover.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
.gitignore
Makefile

index 57f79ef5a2187f3c6124ace71b09c752656c7bd2..d8bd55556972748e344ec7a1c6592ea6a09496ec 100644 (file)
 *.gcno
 *.gcov
 /coverage-untested-functions
+/cover_db/
 *+
 /config.mak
 /autom4te.cache
index 11f1df2787d212bdbbd5dd2b380a71331e9e3488..0de4c6ed5e114e4b891254c3e78ce2898fb92178 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2298,6 +2298,7 @@ coverage-clean:
        $(RM) $(addsuffix *.gcda,$(object_dirs))
        $(RM) $(addsuffix *.gcno,$(object_dirs))
        $(RM) coverage-untested-functions
+       $(RM) -r cover_db/
 
 COVERAGE_CFLAGS = $(CFLAGS) -O0 -ftest-coverage -fprofile-arcs
 COVERAGE_LDFLAGS = $(CFLAGS)  -O0 -lgcov
@@ -2317,3 +2318,6 @@ coverage-untested-functions: coverage-report
        grep '^function.*called 0 ' *.c.gcov \
                | sed -e 's/\([^:]*\)\.gcov: *function \([^ ]*\) called.*/\1: \2/' \
                > coverage-untested-functions
+
+cover_db: coverage-report
+       gcov2perl -db cover_db *.gcov