From: Ralf Wildenhues Date: Sun, 16 Jan 2011 12:48:17 +0000 (+0100) Subject: parallel-tests: work around Tru64/OSF 5.1 sh read bugs. X-Git-Tag: v1.11.1b~35^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=080efc945a834569156c2fc11e7623853e1bdd04;p=thirdparty%2Fautomake.git parallel-tests: work around Tru64/OSF 5.1 sh read bugs. * lib/am/check.am ($(TEST_SUITE_LOG), recheck, recheck-html): Test file readability before redirecting input from it, to avoid exiting Tru64/OSF 5.1 sh which treats read as special builtin. * tests/parallel-tests-unreadable-log.test: New test. * tests/Makefile.am (TESTS): Update. * NEWS: Update. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index 9d2428d16..cbc0415a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2011-01-16 Ralf Wildenhues + Stefano Lattarini + + parallel-tests: work around Tru64/OSF 5.1 sh read bugs. + * lib/am/check.am ($(TEST_SUITE_LOG), recheck, recheck-html): + Test file readability before redirecting input from it, to avoid + exiting Tru64/OSF 5.1 sh which treats read as special builtin. + * tests/parallel-tests-unreadable-log.test: New test. + * tests/Makefile.am (TESTS): Update. + * NEWS: Update. + 2011-01-16 Ralf Wildenhues * NEWS, README: Update copyright years. diff --git a/NEWS b/NEWS index 40cd8ef63..b5cb6e99a 100644 --- a/NEWS +++ b/NEWS @@ -53,6 +53,9 @@ Bugs fixed in 1.11.0a: - The code for automatic dependency tracking works around a Solaris make bug triggered by sources containing repeated slashes when the `subdir-objects' option was used. + + - The parallel-tests driver now does not produce erroneous results + with Tru64/OSF 5.1 sh upon unreadable log files any more. New in 1.11: diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in index 4b2c57f22..b4940db79 100644 --- a/lib/Automake/tests/Makefile.in +++ b/lib/Automake/tests/Makefile.in @@ -324,7 +324,8 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__sh_e_setup); \ list='$(TEST_LOGS)'; \ results=`for f in $$list; do \ - read line < $$f && echo "$$line" || echo FAIL; \ + test -r $$f && read line < $$f && echo "$$line" \ + || echo FAIL; \ done`; \ all=`echo "$$results" | sed '/^$$/d' | wc -l | sed -e 's/^[ ]*//'`; \ fail=`echo "$$results" | grep -c '^FAIL'`; \ @@ -373,7 +374,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) echo ".. contents:: :depth: 2"; \ echo; \ for f in $$list; do \ - read line < $$f; \ + test -r $$f && read line < $$f || line=; \ case $$line in \ PASS:*|XFAIL:*);; \ *) echo; cat $$f;; \ @@ -437,7 +438,7 @@ recheck recheck-html: list='$(TEST_LOGS)'; \ list=`for f in $$list; do \ test -f $$f || continue; \ - if read line < $$f; then \ + if test -r $$f && read line < $$f; then \ case $$line in FAIL*|XPASS*) echo $$f;; esac; \ else echo $$f; fi; \ done | tr '\012\015' ' '`; \ diff --git a/lib/am/check.am b/lib/am/check.am index c953be877..572808143 100644 --- a/lib/am/check.am +++ b/lib/am/check.am @@ -1,6 +1,6 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 2001, 2003, 2006, 2007, 2008, 2009, 2010 Free Software -## Foundation, Inc. +## Copyright (C) 2001, 2003, 2006, 2007, 2008, 2009, 2010, 2011 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 @@ -146,7 +146,8 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__sh_e_setup); \ list='$(TEST_LOGS)'; \ results=`for f in $$list; do \ - read line < $$f && echo "$$line" || echo FAIL; \ + test -r $$f && read line < $$f && echo "$$line" \ + || echo FAIL; \ done`; \ all=`echo "$$results" | sed '/^$$/d' | wc -l | sed -e 's/^[ ]*//'`; \ fail=`echo "$$results" | grep -c '^FAIL'`; \ @@ -195,7 +196,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) echo ".. contents:: :depth: 2"; \ echo; \ for f in $$list; do \ - read line < $$f; \ + test -r $$f && read line < $$f || line=; \ case $$line in \ PASS:*|XFAIL:*);; \ *) echo; cat $$f;; \ @@ -287,7 +288,7 @@ recheck recheck-html: list='$(TEST_LOGS)'; \ list=`for f in $$list; do \ test -f $$f || continue; \ - if read line < $$f; then \ + if test -r $$f && read line < $$f; then \ case $$line in FAIL*|XPASS*) echo $$f;; esac; \ else echo $$f; fi; \ done | tr '\012\015' ' '`; \ diff --git a/tests/Makefile.am b/tests/Makefile.am index 890e69b6f..713dd92db 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -567,6 +567,7 @@ parallel-tests7.test \ parallel-tests8.test \ parallel-tests9.test \ parallel-tests10.test \ +parallel-tests-unreadable-log.test \ parse.test \ percent.test \ percent2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 7600c146b..45adb046f 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -834,6 +834,7 @@ parallel-tests7.test \ parallel-tests8.test \ parallel-tests9.test \ parallel-tests10.test \ +parallel-tests-unreadable-log.test \ parse.test \ percent.test \ percent2.test \ @@ -1142,7 +1143,8 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__sh_e_setup); \ list='$(TEST_LOGS)'; \ results=`for f in $$list; do \ - read line < $$f && echo "$$line" || echo FAIL; \ + test -r $$f && read line < $$f && echo "$$line" \ + || echo FAIL; \ done`; \ all=`echo "$$results" | sed '/^$$/d' | wc -l | sed -e 's/^[ ]*//'`; \ fail=`echo "$$results" | grep -c '^FAIL'`; \ @@ -1191,7 +1193,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) echo ".. contents:: :depth: 2"; \ echo; \ for f in $$list; do \ - read line < $$f; \ + test -r $$f && read line < $$f || line=; \ case $$line in \ PASS:*|XFAIL:*);; \ *) echo; cat $$f;; \ @@ -1255,7 +1257,7 @@ recheck recheck-html: list='$(TEST_LOGS)'; \ list=`for f in $$list; do \ test -f $$f || continue; \ - if read line < $$f; then \ + if test -r $$f && read line < $$f; then \ case $$line in FAIL*|XPASS*) echo $$f;; esac; \ else echo $$f; fi; \ done | tr '\012\015' ' '`; \ diff --git a/tests/parallel-tests-unreadable-log.test b/tests/parallel-tests-unreadable-log.test new file mode 100755 index 000000000..6ebb2b62d --- /dev/null +++ b/tests/parallel-tests-unreadable-log.test @@ -0,0 +1,59 @@ +#! /bin/sh +# Copyright (C) 2011 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 . + +# Check that the testsuite driver copes well with unreadable test logs. + +parallel_tests=yes +. ./defs || Exit 1 + +cat >> configure.in << 'END' +AC_OUTPUT +END + +cat > Makefile.am << 'END' +TESTS = foo.test bar.test +XFAIL_TESTS = bar.test +END + +cat > foo.test << 'END' +#! /bin/sh +exit 0 +END +cat > bar.test << 'END' +#! /bin/sh +exit 1 +END +chmod a+x foo.test bar.test + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a + +# The testsuite driver will use this variable, so ensure it sanitizes +# it and do not allow in spurious values from the environment. +line=PASS; export line + +./configure + +$MAKE foo.log +$MAKE bar.log +chmod a-r foo.log bar.log +$MAKE test-suite.log >stdout && { cat stdout; Exit 1; } +cat stdout +grep '^2 of 2 tests failed *$' stdout +grep '^2 of 2 tests failed\. *$' test-suite.log + +: