From: Ralf Wildenhues Date: Tue, 18 Jan 2011 21:58:18 +0000 (+0100) Subject: tests: work around Tru64 sh -e issues for instspc*.test. X-Git-Tag: ng-0.5a~245^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7069a8b33278ef1d031a4d25482b3a6767e665b8;p=thirdparty%2Fautomake.git tests: work around Tru64 sh -e issues for instspc*.test. Apparently, Tru64 sh does not like turning off errexit mode, and gets confused. * tests/defs: Document 'errexit' cleanliness requirement. * tests/defs-static.in: Likewise. Avoid error from command substitution to abort instspc*.test with Tru64/OSF 5.1 sh. * tests/instspc-tests.sh: Drop now-unneeded temporary errexit dropping. Add strategic '|| Exit' to let tests work on Tru64. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index 99904b233..255258012 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2011-01-19 Ralf Wildenhues + + tests: work around Tru64 sh -e issues for instspc*.test. + Apparently, Tru64 sh does not like turning off errexit mode, + and gets confused. + * tests/defs: Document 'errexit' cleanliness requirement. + * tests/defs-static.in: Likewise. Avoid error from command + substitution to abort instspc*.test with Tru64/OSF 5.1 sh. + * tests/instspc-tests.sh: Drop now-unneeded temporary errexit + dropping. Add strategic '|| Exit' to let tests work on Tru64. + 2011-01-15 Stefano Lattarini tests: hard error in case of internal failures or signal caught diff --git a/tests/defs b/tests/defs index 41c3505a2..fb9be8a5c 100644 --- a/tests/defs +++ b/tests/defs @@ -21,6 +21,8 @@ ## Source static setup and definitions for the testsuite. ## ## -------------------------------------------------------- ## +# This code needs to be 'set -e' clean. + # Ensure we are running from the right directory. test -f ./defs-static || { echo "$0: ./defs-static: not found in current directory" >&2 diff --git a/tests/defs-static.in b/tests/defs-static.in index 91431783d..901620712 100644 --- a/tests/defs-static.in +++ b/tests/defs-static.in @@ -2,7 +2,8 @@ # @configure_input@ # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +# 2005, 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 @@ -18,7 +19,8 @@ # along with this program. If not, see . # Defines and minimal setup for Automake testing environment. -# IMPORTANT: Multiple inclusions of this file should be idempotent! +# Multiple inclusions of this file should be idempotent! +# This code needs to be 'set -e' clean. # Be more Bourne compatible. # (Snippet inspired to configure's initialization in Autoconf 2.64) @@ -57,7 +59,8 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then fi else argv0=$0 - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac + # Avoid command substitution failure, for Tru64 sh -e and instspc*.test. + case `(set -o) 2>/dev/null || :` in *posix*) set -o posix;; esac fi testsrcdir='@abs_srcdir@' diff --git a/tests/instspc-tests.sh b/tests/instspc-tests.sh index 90087eb0c..78f40c4c2 100755 --- a/tests/instspc-tests.sh +++ b/tests/instspc-tests.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2010 Free Software Foundation, Inc. +# Copyright (C) 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 @@ -191,12 +191,8 @@ fi ### If we are still here, we have to run a test ... -# We'll need the full setup provided by `tests/defs'. Temporarly disable -# the errexit flag, since the setup code might not be prepared to deal -# with it. -set +e +# We'll need the full setup provided by `tests/defs'. . ./defs || Exit 99 -set -e eval "instspc_test_string=\${instspc__$instspc_test_name}" || Exit 99 if test x"$instspc_test_string" = x; then @@ -296,6 +292,8 @@ cd "./$build" ../configure --prefix "/$instspc_test_string-prefix" $MAKE -DESTDIR="$dest" file="$instspc_test_string" $MAKE -e test-install-sep +# Tru64 sh -e needs '|| Exit' in order to work correctly. +DESTDIR="$dest" file="$instspc_test_string" $MAKE -e test-install-sep \ + || Exit 1 :