Skip to content

Commit 7f05e4a

Browse files
committed
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
2 parents debecc5 + 5ce4367 commit 7f05e4a

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

Makefile

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,7 +2463,7 @@ profile-clean:
24632463
$(RM) $(addsuffix *.gcda,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
24642464
$(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
24652465

2466-
clean: profile-clean
2466+
clean: profile-clean coverage-clean
24672467
$(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \
24682468
builtin/*.o $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)
24692469
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
@@ -2544,29 +2544,34 @@ check-builtins::
25442544

25452545
### Test suite coverage testing
25462546
#
2547-
.PHONY: coverage coverage-clean coverage-build coverage-report
2547+
.PHONY: coverage coverage-clean coverage-compile coverage-test coverage-report
2548+
.PHONY: coverage-clean-results
25482549

25492550
coverage:
2550-
$(MAKE) coverage-build
2551-
$(MAKE) coverage-report
2551+
$(MAKE) coverage-test
2552+
$(MAKE) coverage-untested-functions
25522553

25532554
object_dirs := $(sort $(dir $(OBJECTS)))
2554-
coverage-clean:
2555+
coverage-clean-results:
25552556
$(RM) $(addsuffix *.gcov,$(object_dirs))
25562557
$(RM) $(addsuffix *.gcda,$(object_dirs))
2557-
$(RM) $(addsuffix *.gcno,$(object_dirs))
25582558
$(RM) coverage-untested-functions
25592559
$(RM) -r cover_db/
25602560
$(RM) -r cover_db_html/
25612561

2562+
coverage-clean: coverage-clean-results
2563+
$(RM) $(addsuffix *.gcno,$(object_dirs))
2564+
25622565
COVERAGE_CFLAGS = $(CFLAGS) -O0 -ftest-coverage -fprofile-arcs
25632566
COVERAGE_LDFLAGS = $(CFLAGS) -O0 -lgcov
25642567
GCOVFLAGS = --preserve-paths --branch-probabilities --all-blocks
25652568

2566-
coverage-build: coverage-clean
2569+
coverage-compile:
25672570
$(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" all
2571+
2572+
coverage-test: coverage-clean-results coverage-compile
25682573
$(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \
2569-
-j1 test
2574+
DEFAULT_TEST_TARGET=test -j1 test
25702575

25712576
coverage-report:
25722577
$(QUIET_GCOV)for dir in $(object_dirs); do \

0 commit comments

Comments
 (0)