From d3a51faf8b62c80423dc71cd7d307fca6a2aa520 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Thu, 28 Jun 2012 21:52:37 +0200 Subject: tests: remove stale workarounds for Solaris /bin/sh Our testsuite cannot be run with that shell anymore (as it is not POSIX-compliant). * t/tap-more.sh: Remove outdated workarounds for Solaris /bin/sh. * t/self-check-exit.tap: Likewise. * t/ansi2knr-no-more.sh: Likewise. * t/add-missing.tap: Likewise. * t/dist-auxfile.sh: Likewise. * t/test-driver-custom-multitest-recheck2.sh: Likewise. * t/ax/test-init.sh: Remove obsolete references to Solaris /bin/sh. * t/confh5.sh: Likewise. * t/uninstall-fail.sh: Likewise. And update comments about quirks of Solaris /bin/ksh and /usr/xpg4/bin/sh. Signed-off-by: Stefano Lattarini --- t/add-missing.tap | 6 ++---- t/ansi2knr-no-more.sh | 2 +- t/ax/test-init.sh | 9 ++++----- t/confh5.sh | 1 - t/dist-auxfile.sh | 2 +- t/self-check-exit.tap | 17 +---------------- t/tap-more.sh | 16 ++++------------ t/test-driver-custom-multitest-recheck2.sh | 2 -- t/uninstall-fail.sh | 20 ++++++++++---------- 9 files changed, 23 insertions(+), 52 deletions(-) diff --git a/t/add-missing.tap b/t/add-missing.tap index 0ba69708f..c47382b5f 100755 --- a/t/add-missing.tap +++ b/t/add-missing.tap @@ -99,11 +99,9 @@ check_ () # shared by its "subtests"). mkdir generic cd generic - # Use 'echo > ...', not ': > ...', here and below, as Solaris 10 /bin/sh - # might not execute the latter (the Autoconf manual gives more details). - echo > Makefile.am + : > Makefile.am if test $override = yes; then - echo > configure.ac + : > configure.ac else cp "$ocwd"/configure.stub configure.ac fi diff --git a/t/ansi2knr-no-more.sh b/t/ansi2knr-no-more.sh index 452abd381..5387d20fb 100755 --- a/t/ansi2knr-no-more.sh +++ b/t/ansi2knr-no-more.sh @@ -45,7 +45,7 @@ for opt in ansi2knr lib/ansi2knr; do AUTOMAKE_fails -Wnone grep "^Makefile\.am:1:.*$warn_rx" stderr # ansi2knr option in configure.ac - echo > Makefile.am # 'echo', not ':', for Solaris /bin/sh. + : > Makefile.am sed "s|^\\(AM_INIT_AUTOMAKE\\).*|\1([$opt])|" configure.sav >configure.ac cat configure.ac # For debugging. rm -rf autom4te*.cache diff --git a/t/ax/test-init.sh b/t/ax/test-init.sh index d0b4cd7fc..cf441881a 100644 --- a/t/ax/test-init.sh +++ b/t/ax/test-init.sh @@ -807,8 +807,8 @@ do priv_check_temp=priv-check.$$ touch $priv_check_temp && chmod a-w $priv_check_temp \ || framework_failure_ "creating unwritable file $priv_check_temp" - # Not a useless use of subshell: lesser shells like Solaris /bin/sh - # can exit if a builtin fails. + # Not a useless use of subshell: lesser shells might bail + # out if a builtin fails. overwrite_status=0 (echo foo >> $priv_check_temp) || overwrite_status=$? rm -f $priv_check_temp @@ -840,8 +840,8 @@ do ro_dir_temp=ro_dir.$$ mkdir $ro_dir_temp && chmod a-w $ro_dir_temp \ || framework_failure_ "creating unwritable directory $ro_dir_temp" - # Not a useless use of subshell: lesser shells like Solaris /bin/sh - # can exit if a builtin fails. + # Not a useless use of subshell: lesser shells might bail + # out if a builtin fails. create_status=0 (: > $ro_dir_temp/probe) || create_status=$? rm -rf $ro_dir_temp @@ -963,7 +963,6 @@ trap "fatal_ 'caught signal SIGTERM'" 15 # OTOH, at least these shells that do *not* exhibit that behaviour: # - modern version of the Almquist Shell (at least 0.5.5.1), on # both Solaris and GNU/Linux -# - Solaris 10 /bin/sh # - public domain Korn Shell, version 5.2.14, on Debian GNU/Linux trap "fatal_ 'caught signal SIGQUIT'" 3 # Ignore further SIGPIPE in the trap code. This is required to avoid diff --git a/t/confh5.sh b/t/confh5.sh index 7da63fec6..354c88c32 100755 --- a/t/confh5.sh +++ b/t/confh5.sh @@ -31,7 +31,6 @@ cat > Makefile.am << 'END' test: distdir test -f $(distdir)/config.h.in test -f $(distdir)/include/config.h.in.in - : # Solaris Sh does not support 'test -e'. test ! -f $(distdir)/include/config.h.in test ! -r $(distdir)/include/config.h.in END diff --git a/t/dist-auxfile.sh b/t/dist-auxfile.sh index 6d130fb6b..21c100c77 100755 --- a/t/dist-auxfile.sh +++ b/t/dist-auxfile.sh @@ -59,7 +59,7 @@ END END mkdir subdir - echo > subdir/Makefile.am # 'echo', not ':', for Solaris /bin/sh. + : > subdir/Makefile.am test -z "$auxdir" || mkdir "$auxdir" || exit 99 diff --git a/t/self-check-exit.tap b/t/self-check-exit.tap index e78ca0b2f..4bc67104f 100755 --- a/t/self-check-exit.tap +++ b/t/self-check-exit.tap @@ -72,23 +72,8 @@ for sig in 1 2 13 15; do done : Non-existent program. -# Solaris 10 /bin/sh erroneously exit with success right away when the -# following three conditions are met at the same time: -# 1. the 'errexit' flag is active, -# 2. an exit trap is installed, and -# 3. a non-existing command is issued. -# Note that the non-existent command is issued as the last command to -# the shell in the next line; this is deliberate. -# FIXME: remove this workaround once we have a better configure-time -# determination of '$AM_TEST_RUNNER_SHELL'. -if $AM_TEST_RUNNER_SHELL -c 'set -e; trap "exit \$?" 0; non-existent-program'; then - maybe_todo=TODO reason="known Solaris /bin/sh bug" -else - maybe_todo="" reason="" -fi $AM_TEST_RUNNER_SHELL -c "$init non-existent-prog; :" "$dummy_test_script" -command_ok_ "command not found" -D "$maybe_todo" -r "$reason" \ - -- test $? -gt 0 +command_ok_ "command not found" -- test $? -gt 0 : Non-executable command. test -f Makefile && test ! -x Makefile || \ diff --git a/t/tap-more.sh b/t/tap-more.sh index b25ffce87..1556d7066 100755 --- a/t/tap-more.sh +++ b/t/tap-more.sh @@ -118,10 +118,7 @@ for try in 0 1; do # Success. # Use append mode here to avoid dropping output. See automake bug#11413. - # Also, use 'echo' here to "nullify" the previous contents of 'stdout', - # since Solaris 10 /bin/sh would try to optimize a ':' away after the - # first iteration, even if it is redirected. - echo " " >stdout + : >stdout $run_make check >>stdout || { cat stdout; exit 1; } cat stdout count_test_results total=6 pass=4 fail=0 xpass=0 xfail=1 skip=1 error=0 @@ -138,15 +135,10 @@ for try in 0 1; do # Failure. - # Use 'echo' here, since Solaris 10 /bin/sh would try to optimize - # a ':' away after the first iteration, even if it is redirected. - echo dummy > not-skip - echo dummy > bail-out + : > not-skip + : > bail-out # Use append mode here to avoid dropping output. See automake bug#11413. - # Also, use 'echo' here to "nullify" the previous contents of 'stdout', - # since Solaris 10 /bin/sh would try to optimize a ':' away after the - # first iteration, even if it is redirected. - echo " " >stdout + : >stdout $run_make check >>stdout && { cat stdout; exit 1; } cat stdout count_test_results total=7 pass=4 fail=1 xpass=0 xfail=1 skip=0 error=1 diff --git a/t/test-driver-custom-multitest-recheck2.sh b/t/test-driver-custom-multitest-recheck2.sh index eab6aacc8..9d8a233c0 100755 --- a/t/test-driver-custom-multitest-recheck2.sh +++ b/t/test-driver-custom-multitest-recheck2.sh @@ -144,8 +144,6 @@ for vpath in : false; do : No need to re-run a.test anymore, but c.test should be rerun, : as it contained an XPASS. And this time, make it fail with : an hard error. - # Use 'echo' here, since Solaris 10 /bin/sh would try to optimize - # a ':' away after the first iteration, even if it is redirected. echo dummy > c.err env TEST_LOGS='a.log c.log' $MAKE -e recheck >stdout \ && { cat stdout; exit 1; } diff --git a/t/uninstall-fail.sh b/t/uninstall-fail.sh index 8f160c886..230832cb3 100755 --- a/t/uninstall-fail.sh +++ b/t/uninstall-fail.sh @@ -76,21 +76,21 @@ chmod a-rwx $inst/share $MAKE uninstall >output 2>&1 && { cat output; exit 1; } cat output # -# Some shells, like Solaris 10 /bin/sh and /bin/ksh, do not report -# the name of the 'cd' builtin upon a chdir error: +# Some shells, like Solaris 10 /bin/ksh and /usr/xpg4/bin/sh, do not +# report the name of the 'cd' builtin upon a chdir error: # -# $ /bin/sh -c 'cd /none' -# /bin/sh: /none: does not exist +# $ /bin/ksh -c 'cd /none' +# /bin/ksh: /none: not found # -# In addition, some shells, like Solaris 10 /usr/xpg4/bin/sh, also print -# a line number in the error message *if the command contains newlines*: +# and also print a line number in the error message *if the command +# contains newlines*: # -# $ /usr/xpg4/bin/sh -c 'cd unreadable' -# /usr/xpg4/bin/sh: unreadable: permission denied -# $ /usr/xpg4/bin/sh -c '\ +# $ /bin/ksh -c 'cd unreadable' +# /bin/ksh: unreadable: permission denied +# $ /bin/ksh -c '\ # > \ # > cd unreadable' -# /usr/xpg4/bin/sh[3]: unreadable: permission denied +# /bin/ksh[3]: unreadable: permission denied # $EGREP "(cd|sh)(\[[0-9]*[0-9]\])?: .*$inst/share" output -- cgit v1.2.1