test-lib: Use "$GIT_BUILD_DIR" instead of "$TEST_DIRECTORY"/../
[gitweb.git] / Makefile
index 11f1df2787d212bdbbd5dd2b380a71331e9e3488..194c26fc5ed09af7f8cf2bc0a2b6a2b959d299e2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -308,6 +308,7 @@ TCL_PATH = tclsh
 TCLTK_PATH = wish
 PTHREAD_LIBS = -lpthread
 PTHREAD_CFLAGS =
+GCOV = gcov
 
 export TCL_PATH TCLTK_PATH
 
@@ -2298,6 +2299,8 @@ coverage-clean:
        $(RM) $(addsuffix *.gcda,$(object_dirs))
        $(RM) $(addsuffix *.gcno,$(object_dirs))
        $(RM) coverage-untested-functions
+       $(RM) -r cover_db/
+       $(RM) -r cover_db_html/
 
 COVERAGE_CFLAGS = $(CFLAGS) -O0 -ftest-coverage -fprofile-arcs
 COVERAGE_LDFLAGS = $(CFLAGS)  -O0 -lgcov
@@ -2310,10 +2313,16 @@ coverage-build: coverage-clean
 
 coverage-report:
        $(QUIET_GCOV)for dir in $(object_dirs); do \
-               gcov $(GCOVFLAGS) --object-directory=$$dir $$dir*.c || exit; \
+               $(GCOV) $(GCOVFLAGS) --object-directory=$$dir $$dir*.c || exit; \
        done
 
 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
+
+cover_db_html: cover_db
+       cover -report html -outputdir cover_db_html cover_db