]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: work around Tru64 sh -e issues for instspc*.test.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 18 Jan 2011 21:58:18 +0000 (22:58 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Wed, 19 Jan 2011 18:54:07 +0000 (19:54 +0100)
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 <Ralf.Wildenhues@gmx.de>
ChangeLog
tests/defs
tests/defs-static.in
tests/instspc-tests.sh

index 99904b233cfccb7c49db8b63847397060f0e84b0..2552580125756ecb51c193374909c03d9b228743 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-01-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       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  <stefano.lattarini@gmail.com>
 
        tests: hard error in case of internal failures or signal caught
index 41c3505a28b37d30628efc5921c048c33834c8d5..fb9be8a5c446554303ab3f49765fb1fcca89b40f 100644 (file)
@@ -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
index 91431783d222fa586af4655ff7f4dc652074c5b2..9016207121f454c4cfedf9d8e694d8cc97cd7906 100644 (file)
@@ -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 <http://www.gnu.org/licenses/>.
 
 # 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@'
index 90087eb0cf6403832611d1d33f463a9526c5ba9d..78f40c4c25f756bb533147f8e471d3d81043d0a5 100755 (executable)
@@ -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
 
 :