Skip to content

Commit 2299120

Browse files
derrickstoleegitster
authored andcommitted
Makefile: add coverage-prove target
Sometimes there are test failures in the 'pu' branch. This is somewhat expected for a branch that takes the very latest topics under development, and those sometimes have semantic conflicts that only show up during test runs. This also can happen when running the test suite with different GIT_TEST_* environment variables that interact in unexpected ways This causes a problem for the test coverage reports, as the typical 'make coverage-test coverage-report' run halts at the first failed test. If that test is early in the suite, then many valuable tests are not exercising the code and the coverage report becomes noisy with false positives. Add a new 'coverage-prove' target to the Makefile, modeled after the 'coverage-test' target. This compiles the source using the coverage flags, then runs the test suite using the 'prove' tool. Since the coverage machinery is not thread-safe, enforce that the tests are run in sequence by appending '-j1' to GIT_PROVE_OPTS. Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 16a465b commit 2299120

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3077,6 +3077,11 @@ coverage-test: coverage-clean-results coverage-compile
30773077
$(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \
30783078
DEFAULT_TEST_TARGET=test -j1 test
30793079

3080+
coverage-prove: coverage-clean-results coverage-compile
3081+
$(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \
3082+
DEFAULT_TEST_TARGET=prove GIT_PROVE_OPTS="$(GIT_PROVE_OPTS) -j1" \
3083+
-j1 test
3084+
30803085
coverage-report:
30813086
$(QUIET_GCOV)for dir in $(object_dirs); do \
30823087
$(GCOV) $(GCOVFLAGS) --object-directory=$$dir $$dir*.c || exit; \

0 commit comments

Comments
 (0)