automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tests: work around Tru64 sh -e issues for instspc*.test.


From: Ralf Wildenhues
Subject: tests: work around Tru64 sh -e issues for instspc*.test.
Date: Tue, 18 Jan 2011 23:17:20 +0100
User-agent: Mutt/1.5.20 (2010-08-04)

This patch fixes all but 9 of the 76 or so instspc*.test failures on
Tru64.  It is for the tests-init branch, or a tests-init-fixes on top of
v1.11-395-ge118126 I guess.  I'll wait a couple of days before pushing.

I haven't analyzed the failure sufficiently to be able to write a patch
for autoconf.texi yet.  But the very last hunk below makes me suspicious
of more removals of '|| Exit 1' "just because".

Thanks,
Ralf

    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.

diff --git a/tests/defs b/tests/defs
index 51d2213..3113869 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 9143178..9016207 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 <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@'
diff --git a/tests/instspc-tests.sh b/tests/instspc-tests.sh
index 90087eb..78f40c4 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
 
 :



reply via email to

[Prev in Thread] Current Thread [Next in Thread]