summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-06-02 22:57:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-06-02 22:57:19 (GMT)
commit67b57a90f41aeba8486db37c2771550c0de03686 (patch)
treea3fc4192444bcf45d05901a6199cbd6ac2bda34f /Makefile
parentedc7f0abcbc42d05a5be1877ded9cc6eba5ec1b6 (diff)
parent5ce4367d644060821a264e00f7e2e98e35dd2d59 (diff)
downloadgit-67b57a90f41aeba8486db37c2771550c0de03686.zip
git-67b57a90f41aeba8486db37c2771550c0de03686.tar.gz
git-67b57a90f41aeba8486db37c2771550c0de03686.tar.bz2
Merge branch 'tr/coverage'
Update the test coverage support that was left to bitrot for some time. * tr/coverage: coverage: build coverage-untested-functions by default coverage: set DEFAULT_TEST_TARGET to avoid using prove coverage: do not delete .gcno files before building coverage: split build target into compile and test
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 13 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 47f3e3c..35e3f7d 100644
--- a/Makefile
+++ b/Makefile
@@ -2469,7 +2469,7 @@ profile-clean:
$(RM) $(addsuffix *.gcda,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
$(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
-clean: profile-clean
+clean: profile-clean coverage-clean
$(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \
builtin/*.o $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
@@ -2550,29 +2550,34 @@ check-builtins::
### Test suite coverage testing
#
-.PHONY: coverage coverage-clean coverage-build coverage-report
+.PHONY: coverage coverage-clean coverage-compile coverage-test coverage-report
+.PHONY: coverage-clean-results
coverage:
- $(MAKE) coverage-build
- $(MAKE) coverage-report
+ $(MAKE) coverage-test
+ $(MAKE) coverage-untested-functions
object_dirs := $(sort $(dir $(OBJECTS)))
-coverage-clean:
+coverage-clean-results:
$(RM) $(addsuffix *.gcov,$(object_dirs))
$(RM) $(addsuffix *.gcda,$(object_dirs))
- $(RM) $(addsuffix *.gcno,$(object_dirs))
$(RM) coverage-untested-functions
$(RM) -r cover_db/
$(RM) -r cover_db_html/
+coverage-clean: coverage-clean-results
+ $(RM) $(addsuffix *.gcno,$(object_dirs))
+
COVERAGE_CFLAGS = $(CFLAGS) -O0 -ftest-coverage -fprofile-arcs
COVERAGE_LDFLAGS = $(CFLAGS) -O0 -lgcov
GCOVFLAGS = --preserve-paths --branch-probabilities --all-blocks
-coverage-build: coverage-clean
+coverage-compile:
$(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" all
+
+coverage-test: coverage-clean-results coverage-compile
$(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \
- -j1 test
+ DEFAULT_TEST_TARGET=test -j1 test
coverage-report:
$(QUIET_GCOV)for dir in $(object_dirs); do \