At Tuesday 25 August 2009, Ralf Wildenhues <ralf.wildenh...@gmx.de> 
wrote:
> * Stefano Lattarini wrote on Tue, Aug 25, 2009 at 02:18:45AM CEST:
> > If you want to err on the side of safety, you could add a warning
> > in tests/README stating not to use zsh to run the test scripts,
> > unless it's symlinked to /bin/sh or called with the
> > `--nofunctionargzero' option.
>
> Care to send a patch?
>
Yes, my try is attached. I changed `tests/README', and updated
`ChangeLog' accordingly.  The patch is generated with the program
`git-format-patch', and since it's the first time I use it, I'm not
sure I did everything correctly.
Also, be warned that I'm not a native speaker, so my wording might
be far from perfect (or downright botched).
>
> > Finally, just to be safe, I'll see what happens running:
> >  $ make -j5 TEST_LOG_COMPILER='zsh  --nofunctionargzero' check
> > on my system.
> >
> > If any error comes up, I will start another thread on the list,
> > reporting it.
Well, some errors are coming up in fact. I will send a new mail after 
the testsuite's run completes and after an examination of logs.
>
> Thanks,
> Ralf


From 137de3be45dd76bfb8bb312215a373903375868a Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <stefano.lattar...@gmail.com>
Date: Tue, 25 Aug 2009 12:12:11 +0200
Subject: [PATCH] tests/README: warn about zsh incompatibilities

	* tests/README (User interface, Getting details from failures):
	now explicitly state that every test is a "shell script", not just
	a "script", and that it's run by `/bin/sh' buy default.
	* tests/README (User interface, Supported shells): new subsection,
	telling about expected portability of the automake test scripts,
	describing a zsh incompatibility w.r.t. $0, and a workaround to
	it (with the `--nofunctionargzero' option).
---
 ChangeLog    |   11 +++++++++++
 tests/README |   32 +++++++++++++++++++++++++-------
 2 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bab1dcb..4f684b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-08-25  Stefano Lattarini  <stefano.lattar...@gmail.com> (tiny change)
+
+	tests/README: warn about zsh incompatibilities
+	* tests/README (User interface, Getting details from failures):
+	now explicitly state that every test is a "shell script", not just
+	a "script", and that it's run by `/bin/sh' buy default.
+	* tests/README (User interface, Supported shells): new subsection,
+	telling about expected portability of the automake test scripts,
+	describing a zsh incompatibility w.r.t. $0, and a workaround to
+	it (with the `--nofunctionargzero' option).
+
 2009-07-08  Jim Meyering  <meyer...@redhat.com>
 
 	manual: fix a trivial grammar error.
diff --git a/tests/README b/tests/README
index c4ff407..46a8c9c 100644
--- a/tests/README
+++ b/tests/README
@@ -32,17 +32,35 @@ Interpretation
 Getting details from failures
 -----------------------------
 
-  Each test is a script.  In a non-VPATH build you can run them
-  directly, they will be verbose.  By default, verbose output of
-  a test foo.test is retained in the log file foo.log.  A summary
-  log is created in the file test-suite.log.
+  Each test is a shell script, and by default is run by /bin/sh.
+  In a non-VPATH build you can run them directly, they will be verbose.
+  By default, verbose output of a test foo.test is retained in the log
+  file foo.log.  A summary log is created in the file test-suite.log.
 
-  You can limit the set of files using the TESTS variable, and
-  enable detailed test output at the end of the test run with the
-  VERBOSE variable:
+  You can limit the set of files using the TESTS variable, and enable
+  detailed test output at the end of the test run with the VERBOSE
+  variable:
 
     env VERBOSE=x TESTS='first.test second.test ...' make -e check
 
+Supported shells
+----------------
+
+  The test scripts are written with portability in mind, so that they
+  should run an any decent bourne-compatible shell.
+  
+  However, some care must be used with Zsh, since, when not directly
+  starting in bourne-compatibility mode, it as 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:
+    zsh --nofunctionargzero foo.test
+
+  Note that this problem does not occur if zsh is executed through a
+  symlink with `sh' basename, since in that case it immediatly starts
+  in bourne-compatibility mode.  So you should be perfectly safe even
+  having zsh as your /bin/sh.
 
 Reporting failures
 ------------------
-- 
1.6.3.3

Reply via email to