automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-557-


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-557-g8950590
Date: Wed, 22 Dec 2010 20:03:42 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=89505905738a5645963b8d0f24daa7a857203aca

The branch, master has been updated
       via  89505905738a5645963b8d0f24daa7a857203aca (commit)
       via  7cd2094693437d3d7fbdb69d577758fe1d6e0900 (commit)
       via  d40b95dca3b7b5f03b17772ad8367690d030e5e8 (commit)
      from  5f2cd97d68da0164a7a58fd30223fb04d639918b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 89505905738a5645963b8d0f24daa7a857203aca
Merge: 5f2cd97 7cd2094
Author: Stefano Lattarini <address@hidden>
Date:   Wed Dec 22 21:01:07 2010 +0100

    Merge branch 'tests-init'

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog            |   37 +++++++++++++++++++++++++++++++++++++
 tests/README         |   20 +++++++++++---------
 tests/defs           |    2 +-
 tests/defs-static.in |   50 +++++++++++++++++++++++++++++++++++++++++++++-----
 tests/help.test      |    7 ++++---
 tests/help2.test     |    7 ++++---
 tests/help3.test     |    7 ++++---
 tests/help4.test     |    7 ++++---
 8 files changed, 110 insertions(+), 27 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c3e6d3a..2c057a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,42 @@
 2010-12-22  Stefano Lattarini  <address@hidden>
 
+       Fix parallel testsuite run with Zsh.
+       This change deals with a Zsh incompatibility in the handling
+       of the special shell variable `$0' in sourced files; this
+       incompatibility used to cause utter breakage when the
+       Automake testsuite was run in parallel mode with Zsh as
+       the $(TEST_LOG_COMPILER).
+       For more information, please refer to the thread "Fix parallel
+       testsuite run with zsh" on automake-patches, dated 2010-12-22:
+        
<http://lists.gnu.org/archive/html/automake-patches/2010-12/msg00135.html>
+       This change works around the problems described above for Zsh 4.3
+       or later, and offers better error messages (instead of random
+       failures) for earlier Zsh version.
+       * tests/README (Supported shells): When describing the manual
+       workaround about the Zsh incompatibility in the handling of `$0',
+       tell that it is now needed only with Zsh versions preceding 4.3.
+       Done also some minor rewordings.
+       * tests/defs-static.in ($argv0): New variable, offers a workaround
+       for the Zsh incompatibility in the handling of `$0'.
+       Abort if that variable cannot be correctly set (can happen only
+       in older Zsh version).
+       * tests/defs ($me): Define using `$argv0', not `$0'.
+
+2010-12-22  Stefano Lattarini  <address@hidden>
+
+       Tests defs: keep track of original $AUTOMAKE and $ACLOCAL values.
+       This is especially useful for tests which might want to run
+       automake and aclocal without additional flags and warnings.
+       * tests/defs-static.in ($original_ACLOCAL): New variable.
+       ($original_AUTOMAKE): Likewise.
+       * tests/help.test: Use them.
+       * tests/help2.test: Likewise.
+       * tests/help3.test: Likewise.
+       * tests/help4.test: Likewise.
+       From a suggestion by Ralf Wildenhues.
+
+2010-12-22  Stefano Lattarini  <address@hidden>
+
        distlinksbrk.test: Work around botched "make -k".
        * tests/distlinksbrk.test: Run "make" multiple times and grep
        its output each time for a single error message, rather than
diff --git a/tests/README b/tests/README
index 88da783..1369bd3 100644
--- a/tests/README
+++ b/tests/README
@@ -70,17 +70,19 @@ Supported shells
   should run with any decent Bourne-compatible shell.
 
   However, some care must be used with Zsh, since, when not directly
-  starting in Bourne-compatibility mode, it has some incompatibilities
-  in the handling of `$0' which conflict with our usage, and which have
-  no easy workaround.  Thus, if you want to run a test script, say
-  foo.test, with Zsh, you *can't* simply do `zsh foo.test', but you
-  *must* resort to:
+  started in Bourne-compatibility mode, it has some incompatibilities
+  in the handling of `$0' which conflict with our usage.  Our testsuite
+  can automatically work around these incompatibilities when a version
+  4.3 or later of Zsh is used, but unfortunately not when an older
+  version of Zsh is used.  Thus, if you want to run a test script, say
+  foo.test, with Zsh 4.2, you *can't* simply do `zsh foo.test', but
+  you *must* resort to:
     zsh -o no_function_argzero foo.test
 
-  Note that this problem does not occur if zsh is executed through a
-  symlink with a basename of `sh', since in that case it starts
-  in Bourne compatibility mode.  So you should be perfectly safe when
-  /bin/sh is zsh.
+  Note that this problem does not occur if Zsh is executed through
+  a symlink with a basename of `sh', since in that case Zsh starts
+  in Bourne compatibility mode.  So you should be perfectly safe
+  when /bin/sh is Zsh, even a it's version < 4.3.
 
 
 Reporting failures
diff --git a/tests/defs b/tests/defs
index 134dc78..f04a756 100644
--- a/tests/defs
+++ b/tests/defs
@@ -30,7 +30,7 @@ test -f ./defs-static || {
 . ./defs-static || exit 99
 
 # The name of the current test (without the `.test' suffix.)
-me=`echo "$0" | sed -e 's,.*[\\/],,;s/\.test$//'`
+me=`echo "$argv0" | sed -e 's,.*[\\/],,;s/\.test$//'`
 
 
 ## ---------------------------------------- ##
diff --git a/tests/defs-static.in b/tests/defs-static.in
index 2ca4b57..9143178 100644
--- a/tests/defs-static.in
+++ b/tests/defs-static.in
@@ -21,7 +21,7 @@
 # IMPORTANT: Multiple inclusions of this file should be idempotent!
 
 # Be more Bourne compatible.
-# (Snippet copied from configure's initialization in Autoconf 2.64)
+# (Snippet inspired to configure's initialization in Autoconf 2.64)
 DUALCASE=1; export DUALCASE # for MKS sh
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
@@ -30,7 +30,33 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 
2>&1; then
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
+  # If Zsh is not started directly in Bourne-compatibility mode, it has
+  # some incompatibilities in the handling of `$0' that conflict with
+  # our usage: i.e., `$0' inside a file sourced with the `.' builtin is
+  # temporarily set to the name of the sourced file.
+  # Work around this when possible, otherwise abort the script.
+  # Note that a bug in some versions of Zsh prevents us from resetting $0
+  # in a sourced script, so the use of $argv0.  For more info see:
+  #  <http://www.zsh.org/mla/workers/2009/msg01140.html>
+  # Note: the apparently useless 'eval' below are needed by at least
+  # dash 0.5.2, to prevent it from bailing out with an error like
+  # "Syntax error: Bad substitution"
+  if eval '[[ "$0" = *."test" ]]'; then
+    # Good, FUNCTION_ARGZERO option was already off when this file was
+    # sourced.  Thus we've nothing to do.
+    argv0=$0
+  elif eval 'test -n "${functrace[-1]}"'; then
+    # FUNCTION_ARGZERO option was on, but we have a easy workaround.
+    eval 'argv0=${functrace[-1]%:*}'
+  else
+    # Give up.
+    echo "$0: cannot determine the path of running test script" >&2
+    echo "$0: test was running with Zsh version $ZSH_VERSION" >&2
+    echo "$0: did you enable the NO_FUNCTION_ARGZERO option?" >&2
+    exit 99
+  fi
 else
+  argv0=$0
   case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
 fi
 
@@ -51,8 +77,16 @@ test -z "$AUTOCONF" && AUTOCONF="@am_AUTOCONF@"
 test -z "$AUTOHEADER" && AUTOHEADER="@am_AUTOHEADER@"
 test -z "$AUTOUPDATE" && AUTOUPDATE=autoupdate
 test -z "$MISSING" && MISSING=$top_testsrcdir/lib/missing
+
 # Use -Werror because this also turns some Perl warnings into error.
-# (Tests for which this is inappropriate should use -Wno-error.)
+# Tests for which this is inappropriate should use -Wno-error.
+# Tests who want complete control over aclocal command-line options
+# should use $original_ACLOCAL.
+# Note: the first `test -z' conditional below is to ensure defs-static
+# really remains idempotent.
+if test -z "$original_ACLOCAL"; then
+  original_ACLOCAL=${ACLOCAL-"aclocal-$APIVERSION"}
+fi
 test -z "$ACLOCAL" && ACLOCAL="aclocal-$APIVERSION -Werror"
 # Extra flags to pass to aclocal before all other flags added by this script.
 ACLOCAL_TESTSUITE_FLAGS=''; export ACLOCAL_TESTSUITE_FLAGS
@@ -60,9 +94,15 @@ ACLOCAL_TESTSUITE_FLAGS=''; export ACLOCAL_TESTSUITE_FLAGS
 # See how Automake should be run.  We put --foreign as the default
 # strictness to avoid having to create lots and lots of files.  A test
 # can override this by specifying a different strictness.  Use -Wall
-# -Werror by default.  Tests for which this is inappropriate
-# (e.g. when testing that a warning is enabled by a specific switch)
-# should use -Wnone or/and -Wno-error
+# -Werror by default.  Tests for which this is inappropriate (e.g. when
+# testing that a warning is enabled by a specific switch) should use
+# -Wnone or/and -Wno-error.  Tests who want complete control over
+# automake command-line options should use $original_AUTOMAKE.
+# Note: the first `test -z' conditional below is to ensure defs-static
+# really remains idempotent.
+if test -z "$original_AUTOMAKE"; then
+  original_AUTOMAKE=${AUTOMAKE-"automake-$APIVERSION"}
+fi
 test -z "$AUTOMAKE" && AUTOMAKE="automake-$APIVERSION --foreign -Werror -Wall"
 
 # POSIX no longer requires 'egrep' and 'fgrep',
diff --git a/tests/help.test b/tests/help.test
index dd8b3b4..d8aa96f 100755
--- a/tests/help.test
+++ b/tests/help.test
@@ -25,9 +25,10 @@ set -e
 mkdir emptydir
 cd emptydir
 
-# Honour user overrides for $ACLOCAL and $AUTOMAKE.
-ACLOCAL=`echo " $ACLOCAL " | sed 's/ -W[^ ]*/ /g'`
-AUTOMAKE=`echo " $AUTOMAKE " | sed 's/ -W[^ ]*/ /g'`
+# Honour user overrides for $ACLOCAL and $AUTOMAKE, but without
+# adding extra options.
+ACLOCAL=$original_ACLOCAL
+AUTOMAKE=$original_AUTOMAKE
 
 $ACLOCAL --version
 $ACLOCAL --help
diff --git a/tests/help2.test b/tests/help2.test
index b74f30a..dafbbf6 100755
--- a/tests/help2.test
+++ b/tests/help2.test
@@ -24,9 +24,10 @@ set -e
 mkdir cleandir
 cd cleandir
 
-# Honour user overrides for $ACLOCAL and $AUTOMAKE.
-ACLOCAL=`echo " $ACLOCAL " | sed 's/ -W[^ ]*/ /g'`
-AUTOMAKE=`echo " $AUTOMAKE " | sed 's/ -W[^ ]*/ /g'`
+# Honour user overrides for $ACLOCAL and $AUTOMAKE, but without
+# adding extra options.
+ACLOCAL=$original_ACLOCAL
+AUTOMAKE=$original_AUTOMAKE
 
 echo '[' > configure.in
 echo '[' > acinclude.m4
diff --git a/tests/help3.test b/tests/help3.test
index 72399e3..d3652ea 100755
--- a/tests/help3.test
+++ b/tests/help3.test
@@ -24,9 +24,10 @@ set -e
 mkdir cleandir
 cd cleandir
 
-# Honour user overrides for $ACLOCAL and $AUTOMAKE.
-ACLOCAL=`echo " $ACLOCAL " | sed 's/ -W[^ ]*/ /g'`
-AUTOMAKE=`echo " $AUTOMAKE " | sed 's/ -W[^ ]*/ /g'`
+# Honour user overrides for $ACLOCAL and $AUTOMAKE, but without
+# adding extra options.
+ACLOCAL=$original_ACLOCAL
+AUTOMAKE=$original_AUTOMAKE
 
 cat > configure.in <<END
 AC_INIT([$me], [1.0])
diff --git a/tests/help4.test b/tests/help4.test
index 1b7de41..3efb076 100755
--- a/tests/help4.test
+++ b/tests/help4.test
@@ -25,9 +25,10 @@ set -e
 mkdir emptydir
 cd emptydir
 
-# Honour user overrides for $ACLOCAL and $AUTOMAKE.
-ACLOCAL=`echo " $ACLOCAL " | sed 's/ -W[^ ]*/ /g'`
-AUTOMAKE=`echo " $AUTOMAKE " | sed 's/ -W[^ ]*/ /g'`
+# Honour user overrides for $ACLOCAL and $AUTOMAKE, but without
+# adding extra options.
+ACLOCAL=$original_ACLOCAL
+AUTOMAKE=$original_AUTOMAKE
 
 escape_dots () { sed 's/\./\\./g'; } # avoid issues with `\' in backquotes
 apiversion_rx=`echo "$APIVERSION" | escape_dots`


hooks/post-receive
-- 
GNU Automake



reply via email to

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