diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-06-27 12:47:17 +0200 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-06-27 13:18:27 +0200 |
commit | 2a3e45d6f3083c5152d94156f8b4e21366090c0f (patch) | |
tree | 8ef5620eebe733a542afc4d489703da9fbb6ad31 /t/parallel-tests-recheck-pr11791.sh | |
parent | f7132aee3c5c0024b91c925e712f249838b98c46 (diff) | |
download | automake-2a3e45d6f3083c5152d94156f8b4e21366090c0f.tar.gz |
parallel-tests: "recheck" behaves better in case of compilation failures
With this change, the "recheck" target behaves better in the face of build
failures related to previously failed tests. For example, if a test is a
compiled program that must be rerun by "make recheck", and its compilation
fails, that test will still be rerun by further "make recheck" invocations.
Previously, its '.log' and '.trs' would have both been lost, so that the
test would have not been re-run.
This change fixes automake bug#11791.
* NEWS: Update.
* lib/am/check.am (recheck, check-TESTS): Adjust to cater to scenario
described above.
* t/parallel-tests-recheck-pr11791.sh: New test.
* t/list-of-tests.mk: Add it.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 't/parallel-tests-recheck-pr11791.sh')
-rwxr-xr-x | t/parallel-tests-recheck-pr11791.sh | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/t/parallel-tests-recheck-pr11791.sh b/t/parallel-tests-recheck-pr11791.sh new file mode 100755 index 000000000..bfc55fa15 --- /dev/null +++ b/t/parallel-tests-recheck-pr11791.sh @@ -0,0 +1,87 @@ +#! /bin/sh +# Copyright (C) 2012 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# parallel-tests: "make recheck" "make -k recheck" in the face of build +# failures for the test cases. See automake bug#11791. + +required='cc native' +. ./defs || Exit 1 + +cat >> configure.ac << 'END' +AC_PROG_CC +AC_OUTPUT +END + +cat > Makefile.am << 'END' +TESTS = $(EXTRA_PROGRAMS) +EXTRA_PROGRAMS = foo +END + +echo 'int main (void) { return 1; }' > foo.c + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a + +./configure + +$MAKE check >stdout && { cat stdout; Exit 1; } +cat stdout +count_test_results total=1 pass=0 fail=1 xpass=0 xfail=0 skip=0 error=0 + +$MAKE -k recheck >stdout && { cat stdout; Exit 1; } +cat stdout +count_test_results total=1 pass=0 fail=1 xpass=0 xfail=0 skip=0 error=0 + +# Introduce an error in foo.c, that should cause a compilation failure. +$sleep +echo choke me >> foo.c + +$MAKE recheck >stdout && { cat stdout; Exit 1; } +cat stdout +# We don't get a change to run the testsuite. +$EGREP '(X?PASS|X?FAIL|SKIP|ERROR):' stdout && Exit 1 +# These shouldn't be removed, otherwise the next make recheck will do +# nothing. +test -f foo.log +test -f foo.trs + +st=0; $MAKE -k recheck >stdout || st=$? +cat stdout +# Don't trust the exit status of "make -k" for non-GNU makes. +if using_gmake && test $st -eq 0; then Exit 1; fi +# We don't get a change to run the testsuite. +$EGREP '(X?PASS|X?FAIL|SKIP|ERROR):' stdout && Exit 1 +test -f foo.log +test -f foo.trs + +# "Repair" foo.c, and expect everything to work. +$sleep +echo 'int main (void) { return 0; }' > foo.c + +$MAKE recheck >stdout || { cat stdout; Exit 1; } +cat stdout +count_test_results total=1 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=0 +test -f foo.log +test -f foo.trs + +$MAKE recheck >stdout || { cat stdout; Exit 1; } +cat stdout +count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0 +test -f foo.log +test -f foo.trs + +: |