This change avoids potential spurious failures with tests using
the requirement 'xsi-shell' to mean that they want */bin/sh* (not
$SHELL) to be XSI-conforming. This idiom used to work before
commit `
v1.11-874-g1321be7' (as back then the test scripts were
unconditionally run with /bin/sh), but has become inconsistent
now that the test scripts re-execute themselves with configure
determined $SHELL.
The described spurious failures have already occurred in practice,
for examples on Solaris systems which also had GNU Bash installed.
From a suggestion by Peter Rosin. See discussion at:
<http://lists.gnu.org/archive/html/automake-patches/2011-06/msg00016.html>
* tests/defs (xsi-shell): Now check that $SHELL, rather than the
shell currently running the test script, is an XSI shell.
(xsi-bin-sh): New requirement, checking that /bin/sh (which can
differ from $SHELL) is an XSI shell.
(xsi-lib-shell): New requirement, checking that the shell that
should be used to test the Automake-provided scripts from `lib/'
is an XSI shell. For the moment, this is just an alias for
`xsi-bin-sh'.
(require_xsi): New subroutine, used to factor out code common to
the requirements above.
($xsi_shell_code): New variable, contains shell code supposed to
work only with XSI shells. Used by the new subroutine above.
* tests/ar-lib.test ($required): Require 'xsi-lib-shell' instead
of 'xsi-shell', since the script we test here is run with /bin/sh,
not with $SHELL.
* tests/compile3.test: Likewise.
* tests/compile6.test: Likewise.
+2011-06-07 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests defs: better requirements for XSI shells
+ This change avoids potential spurious failures with tests using
+ the requirement 'xsi-shell' to mean that they want */bin/sh* (not
+ $SHELL) to be XSI-conforming. This idiom used to work before
+ commit `v1.11-874-g1321be7' (as back then the test scripts were
+ unconditionally run with /bin/sh), but has become inconsistent
+ now that the test scripts re-execute themselves with configure
+ determined $SHELL.
+ The described spurious failures have already occurred in practice,
+ for examples on Solaris systems which also had GNU Bash installed.
+ From a suggestion by Peter Rosin. See discussion at:
+ <http://lists.gnu.org/archive/html/automake-patches/2011-06/msg00016.html>
+ * tests/defs (xsi-shell): Now check that $SHELL, rather than the
+ shell currently running the test script, is an XSI shell.
+ (xsi-bin-sh): New requirement, checking that /bin/sh (which can
+ differ from $SHELL) is an XSI shell.
+ (xsi-lib-shell): New requirement, checking that the shell that
+ should be used to test the Automake-provided scripts from `lib/'
+ is an XSI shell. For the moment, this is just an alias for
+ `xsi-bin-sh'.
+ (require_xsi): New subroutine, used to factor out code common to
+ the requirements above.
+ ($xsi_shell_code): New variable, contains shell code supposed to
+ work only with XSI shells. Used by the new subroutine above.
+ * tests/ar-lib.test ($required): Require 'xsi-lib-shell' instead
+ of 'xsi-shell', since the script we test here is run with /bin/sh,
+ not with $SHELL.
+ * tests/compile3.test: Likewise.
+ * tests/compile6.test: Likewise.
+
2011-06-02 Stefano Lattarini <stefano.lattarini@gmail.com>
self tests: fix another spurious failure
# Make sure `ar-lib' wraps the Microsoft Library Manager (lib) correctly
-required=xsi-shell
+required=xsi-lib-shell
. ./defs || Exit 1
cp "$top_testsrcdir/lib/ar-lib" .
# Make sure `compile' wraps the Microsoft C/C++ compiler (cl) correctly
-required=xsi-shell
+required=xsi-lib-shell
. ./defs || Exit 1
cp "$top_testsrcdir/lib/compile" .
# Make sure `compile' searches libraries correctly
-required=xsi-shell
+required=xsi-lib-shell
. ./defs || Exit 1
cp "$top_testsrcdir/lib/compile" .
}
sed_unindent_prog="" # Avoid interferences from the environment.
+# require_xsi SHELL
+# -----------------
+# Skip the test if the given shell fails to support common XSI constructs.
+require_xsi ()
+{
+ test $# -eq 1 || framework_failure_ "require_xsi needs exactly one arg"
+ echo "$me: trying some XSI constructs with $1"
+ $1 -c "$xsi_shell_code" || skip_ "$1 lacks XSI features"
+}
+# Shell code supposed to work only with XSI shells. Keep this in sync
+# with libtool.m4:_LT_CHECK_SHELL_FEATURES.
+xsi_shell_code='
+ _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval '\''test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5'\'
+
## ----------------------------------------------------------- ##
## Checks for required tools, and additional setups (if any) ##
test "$FC" = false && skip_ "no Fortran compiler available";;
fortran77)
test "$F77" = false && skip_ "no Fortran 77 compiler available";;
+ xsi-shell)
+ require_xsi "$SHELL";;
+ xsi-bin-sh)
+ require_xsi "/bin/sh";;
+ xsi-lib-shell)
+ require_xsi "/bin/sh";;
bzip2)
# Do not use --version, bzip2 still tries to compress stdin.
echo "$me: running bzip2 --help"
texi2dvi -o /dev/null --version \
|| skip_ "required program \`texi2dvi' not available"
;;
- xsi-shell)
- # Try some XSI features.
- # Keep this in sync with libtool.m4:_LT_CHECK_SHELL_FEATURES.
- echo "$me: trying some XSI constructs"
- ( _am_dummy="a/b/c"
- test "${_am_dummy##*/},${_am_dummy%/*},${_am_dummy#??}"${_am_dummy%"$_am_dummy"}, \
- = c,a/b,b/c, \
- && eval 'test $(( 1 + 1 )) -eq 2 \
- && test "${#_am_dummy}" -eq 5' ) \
- || skip_ "the shell lacks some required XSI features"
- ;;
flex)
# Since flex is required, we pick LEX for ./configure.
LEX=flex