diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-06-02 15:57:18 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-02 15:57:19 -0700 |
commit | 67b57a90f41aeba8486db37c2771550c0de03686 (patch) | |
tree | a3fc4192444bcf45d05901a6199cbd6ac2bda34f /Makefile | |
parent | edc7f0abcbc42d05a5be1877ded9cc6eba5ec1b6 (diff) | |
parent | 5ce4367d644060821a264e00f7e2e98e35dd2d59 (diff) | |
download | git-67b57a90f41aeba8486db37c2771550c0de03686.tar.gz |
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-- | Makefile | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -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 \ |