It turns out that, with NetBSD 5.1 make, running "make recheck" two times in a row quickly fails to correctly re-run the failed tests in the second run.
Issue likely introduced in commit 'v1.12.1-95-gd5443e4' of 20102-07-01, "parallel-tests: reimplement fix for bug#11791", and revealed by failures in at least the several tests: - t/test-driver-custom-multitest-recheck.sh - t/parallel-tests-log-override-recheck.sh - t/tap-recheck.sh * lib/am/check.am (recheck): In the recursive invocation to trigger the re-run of the failed tests, call "make check-TESTS" rather than "make $(TEST_SUITE_LOG)". Also, do not anymore bother removing the '$(TEST_SUITE_LOG)' file by hand, since that is already done in the 'check-TESTS' recipe. * t/tap-recheck.sh: Enhance to catch the just-fixed bug. Signed-off-by: Stefano Lattarini <stefano.lattar...@gmail.com> --- lib/am/check.am | 5 +---- t/parallel-tests9.sh | 16 ++++++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/am/check.am b/lib/am/check.am index e414a90..a5cf4f0 100644 --- a/lib/am/check.am +++ b/lib/am/check.am @@ -428,9 +428,6 @@ check-TESTS: ## Recheck must depend on $(check_SCRIPTS), $(check_PROGRAMS), etc. ## It must also depend on the 'all' target. See automake bug#11252. recheck: all %CHECK_DEPS% -## See comments above in the check-TESTS recipe for why remove -## $(TEST_SUITE_LOG) here. - @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ ## We must only consider tests that had an unexpected outcome (FAIL ## or XPASS) in the earlier run. @@ -452,7 +449,7 @@ recheck: all %CHECK_DEPS% ## will still try to re-compile and re-run it (automake bug#11791). ## The tricky recusrive make invocation below should cater to such ## requirements. - $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + $(MAKE) $(AM_MAKEFLAGS) check-TESTS \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ ## Be sure to exit with the proper exit status (automake bug#9245). See diff --git a/t/parallel-tests9.sh b/t/parallel-tests9.sh index 583c674..08d2bf6 100755 --- a/t/parallel-tests9.sh +++ b/t/parallel-tests9.sh @@ -59,12 +59,16 @@ $MAKE check >stdout && { cat stdout; exit 1; } cat stdout count_test_results total=3 pass=1 fail=1 skip=0 xfail=0 xpass=0 error=1 -$MAKE recheck >stdout && { cat stdout; exit 1; } -cat stdout -count_test_results total=2 pass=0 fail=1 skip=0 xfail=0 xpass=0 error=1 -grep 'foo\.test' stdout && exit 1 -grep '^ERROR: bar\.test$' stdout -grep '^FAIL: baz\.test$' stdout +# Running this two times in a row proved problematic on NetBSD make +# in the past. Ensure we don't regress in that respect. +for i in 1 2; do + $MAKE recheck >stdout && { cat stdout; exit 1; } + cat stdout + count_test_results total=2 pass=0 fail=1 skip=0 xfail=0 xpass=0 error=1 + grep 'foo\.test' stdout && exit 1 + grep '^ERROR: bar\.test$' stdout + grep '^FAIL: baz\.test$' stdout +done # Ensure that recheck builds check_SCRIPTS, and that # recheck reruns nothing if check has not been run. -- 1.7.9.5