提交 7f05e4a6 编写于 作者: J Junio C Hamano

Merge branch 'tr/coverage' into maint

The test coverage framework was left broken 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
......@@ -2463,7 +2463,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
......@@ -2544,29 +2544,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 \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册