tests: cosmetic changes in t/extra-sources.sh
[platform/upstream/automake.git] / t / parallel-tests-recheck-pr11791.sh
old mode 100755 (executable)
new mode 100644 (file)
index 22203c9..1933aa9
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2012 Free Software Foundation, Inc.
+# Copyright (C) 2012-2013 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
@@ -14,8 +14,8 @@
 # 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.
+# parallel-tests: "make recheck" and "make -k recheck" in the face of
+# build failures for the test cases.  See automake bug#11791.
 
 required='cc native'
 . test-init.sh
@@ -38,22 +38,20 @@ $AUTOMAKE -a
 
 ./configure
 
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
 count_test_results total=1 pass=0 fail=1 xpass=0 xfail=0 skip=0 error=0
 
-st=0; $MAKE -k recheck >stdout || st=$?
-cat stdout
+using_gmake || $sleep # Required by BSD make.
+run_make -O -e IGNORE -- -k recheck
 # Don't trust the exit status of "make -k" for non-GNU makes.
-if using_gmake && test $st -eq 0; then exit 1; fi
+! using_gmake || test $am_make_rc -gt 0 || exit 1
 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
+run_make -O -e FAIL recheck
 # 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
@@ -61,10 +59,10 @@ $EGREP '(X?PASS|X?FAIL|SKIP|ERROR):' stdout && exit 1
 test -f foo.log
 test -f foo.trs
 
-st=0; $MAKE -k recheck >stdout || st=$?
-cat stdout
+using_gmake || $sleep # Required by BSD make.
+run_make -O -e IGNORE -- -k recheck
 # Don't trust the exit status of "make -k" for non-GNU makes.
-if using_gmake && test $st -eq 0; then exit 1; fi
+! using_gmake || test $am_make_rc -gt 0 || exit 1
 # We don't get a change to run the testsuite.
 $EGREP '(X?PASS|X?FAIL|SKIP|ERROR):' stdout && exit 1
 test -f foo.log
@@ -74,14 +72,12 @@ test -f foo.trs
 $sleep
 echo 'int main (void) { return 0; }' > foo.c
 
-$MAKE recheck >stdout || { cat stdout; exit 1; }
-cat stdout
+run_make -O recheck
 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
+run_make -O recheck
 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