+2009-07-02 Eric Blake <ebb9@byu.net>
+
+ Skip test on shells that can't catch syntax failure.
+ * tests/autotest.at (Syntax error): Skip test if shell aborts on
+ syntax error (AIX ksh88) or doesn't detect it (zsh).
+ * doc/autoconf.texi (Limitations of Builtins) <.>: Mention these
+ limitations.
+ Reported by Ralf Wildenhues.
+
2009-06-30 Jan Madzik <jmadzik@gmail.com> (tiny change)
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
to use @command{.} on a file @file{foo} in the current directory, you
must use @samp{. ./foo}.
+Not all shells gracefully handle syntax errors within a sourced file.
+On one extreme, some non-interactive shells abort the entire script. On
+the other, @command{zsh} 4.3.10 has a bug where it fails to react to the
+syntax error.
+
+@example
+$ @kbd{echo 'fi' > syntax}
+$ @kbd{bash -c '. ./syntax; echo $?'}
+./syntax: line 1: syntax error near unexpected token `fi'
+./syntax: line 1: `fi'
+1
+$ @kbd{ash -c '. ./syntax; echo $?'}
+./syntax: 1: Syntax error: "fi" unexpected
+$ @kbd{zsh -c '. ./syntax; echo $?'}
+./syntax:1: parse error near `fi'
+0
+@end example
+
@item @command{!}
@c --------------
@prindex @command{!}
AT_CLEANUP
AT_SETUP([another test])
AT_CHECK([:])],
- [], [1], [], [stderr], [],
- [AT_CHECK([grep "unable to parse test group: 2" stderr], [0], [ignore])
- AT_CHECK([$CONFIG_SHELL ./micro-suite 1 3], [0], [ignore])])
+ [], [0], [], [], [],
+ [dnl Until we can find a way to avoid catastrophic failure (ash) or
+ dnl lack of failure (zsh), skip the rest of this test on such shells.
+ echo 'if' > syntax
+ AT_CHECK([${CONFIG_SHELL-$SHELL} -c 'case `. ./syntax; echo $?` in
+ 0|"") exit 77;;
+ esac'], [0], [ignore], [ignore])
+ AT_CHECK([$CONFIG_SHELL ./micro-suite], [1], [ignore], [stderr])
+ AT_CHECK([grep "unable to parse test group: 2" stderr], [0], [ignore])],
+ [1 3])
AT_CHECK_AT_TEST([errexit],
[AT_CHECK([false])