The latest commits in msvc have fixed some bugs (albeit minor), so I'd like to have them in 1.11.2. For this reason, I've merged `msvc' into `msvc-for-1.11', and then `msvc-for-1.11' into `branch-1.11'.
Attaches is the diff of the merge, obtained by basically doing: $ git merge --no-commit && <tweak-results> && git diff --cached I've started testing `branch-1.11' on few systems, and it seems to be behaving good so far (I'll post more details in a new thread, once I have a decent amount of data). Regards, Stefano
diff --git a/ChangeLog b/ChangeLog index 1f2f960..97ffc15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,96 @@ 2011-11-10 Stefano Lattarini <stefano.lattar...@gmail.com> + tests: avoid a spurious failure of 'ltinit.test' MinGW + * tests/ltinit.test: Be laxer in grepping configure output, to + avoid spurious failures on systems which lack POSIX dynamic + linking (e.g., MinGW), or when cross-compiling for such systems. + See also commit `v1.11-855-ge9e5d4a'. + Report and suggestion from Peter Rosin. + +2011-11-08 Stefano Lattarini <stefano.lattar...@gmail.com> + + tests: testsuite is now safe to run with dmake in parallel mode + * tests/defs.in: Unset variables DMAKE_CHILD, DMAKE_DEF_PRINTED + and DMAKE_MAX_JOBS, which are exported by Solaris dmake when run + in parallel mode, and which might confuse make processes spawned + by our testsuite. + +2011-11-08 Stefano Lattarini <stefano.lattar...@gmail.com> + + tests: fix spurious failures w.r.t. parallel make and colorization + * tests/color2.test: Skip the test if the $MAKE program fails to + consider the standard output as a tty when spawned by `expect'. + This is required for make implementations, like FreeBSD make and + Solaris dmake, that redirect the output of recipes to temporary + files or pipes when run in parallel mode. Since we are at it, + simplify the detection of a working `expect' program, and throw + in other minor simplifications. + +2011-11-07 Stefano Lattarini <stefano.lattar...@gmail.com> + + tests: fix spurious failure in 'distcheck-override-infodir.test' + * tests/distcheck-override-infodir.test ($required): Add + 'install-info'. + +2011-11-07 Stefano Lattarini <stefano.lattar...@gmail.com> + + tests: avoid another failure of 'uninstall-fail.test' on Solaris + * tests/uninstall-fail.test: On Solaris 10, if `/bin/rm' is run + with the `-f' option, it doesn't print any error message when + failing to remove a file (due to e.g., "Permission denied"). + Yikes. Cater to this incompatibility, by relaxing the test when + a faulty `rm' is detected. + +2011-11-10 Stefano Lattarini <stefano.lattar...@gmail.com> + + tests: various minor tweakings, mostly related to AM_PROG_AR + * tests/alloca2.test: Ensure we don't experience a spurious failure + due to a missing `AM_PROG_AR' macro or a missing `ar-lib' auxiliary + script. + * tests/libtool4.test: Likewise. + * tests/ldadd.test: Likewise. Since we are at it, make grepping of + automake stderr stricter. + * tests/reqd2.test: Likewise. + * tests/pr211.test: Ensure automake fails also with `-Wnone', since + the error we are testing for is an hard error, not a mere warning. + * tests/syntax.test: Likewise, and ensure we don't fail to other + errors by removing use of `lib_LTLIBRARIES' in Makefile.am. Since + we are at it, make grepping of automake stderr stricter. + +2011-11-05 Stefano Lattarini <stefano.lattar...@gmail.com> + + ar-lib: fix configure output for "unrecognized archiver interface" + * m4/ar-lib.m4: Ensure that, even when an error is hit while trying + to determine the archiver interface kind, the "checking archiver + interface" message from configure is properly terminated before + an error message is printed, to avoid slightly garbled output. + * tests/ar4.test: Enhance. + * tests/ar5.test: Likewise. + +2011-11-04 Stefano Lattarini <stefano.lattar...@gmail.com> + + warnings: fix buglets for portability warnings + * lib/Automake/ChannelDefs.pm (switch_warning): Ensure the + correct implications and inter-dependencies between warnings + in the categories `portability', `extra-portability' and + `recursive-portability' are respected. Also add detailed + explicative comments, and references to the relevant tests. + * tests/dollarvar2.test: Update and extend. Also, remove + some unnecessary uses of `--force' option in automake calls. + * tests/extra-portability3.test: New test. + * tests/Makefile.am (TESTS): Add it. + +2011-11-04 Stefano Lattarini <stefano.lattar...@gmail.com> + + tests: extend tests on 'extra-portability' warning category + * tests/extra-portability.test: Redefine `$AUTOMAKE' to ensure we + have complete control over the automake options. Extend by using + also a setup where no `portability' warning is present (only an + `extra-portability' warning is). Other minor extensions. Remove + some redundant, verbose comments about the expected diagnostic. + +2011-11-10 Stefano Lattarini <stefano.lattar...@gmail.com> + tests: fix broken backport of tests on `extra-portability' warnings * tests/extra-portability2.test: Ensure all the automake invocations have the warnings in the `extra-portability' category enabled. diff --git a/lib/Automake/ChannelDefs.pm b/lib/Automake/ChannelDefs.pm index 8dff186..9b6d3a5 100644 --- a/lib/Automake/ChannelDefs.pm +++ b/lib/Automake/ChannelDefs.pm @@ -304,6 +304,7 @@ sub switch_warning ($) if ($cat eq 'extra-portability' && ! $has_no) { setup_channel 'portability', silent => 0; + setup_channel 'portability-recursive', silent => 0; $have_extra_portability = 1; } } diff --git a/m4/ar-lib.m4 b/m4/ar-lib.m4 index 822ca60..e45c558 100644 --- a/m4/ar-lib.m4 +++ b/m4/ar-lib.m4 @@ -33,8 +33,7 @@ AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else - m4_default([$1], - [AC_MSG_ERROR([could not determine $AR interface])]) + am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a @@ -53,6 +52,10 @@ lib) # similar. AR="$am_aux_dir/ar-lib $AR" ;; +unknown) + m4_default([$1], + [AC_MSG_ERROR([could not determine $AR interface])]) + ;; esac AC_SUBST([AR])dnl ]) diff --git a/tests/Makefile.am b/tests/Makefile.am index 8056f2d..a27cdaf 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -398,6 +398,7 @@ extra11.test \ extra12.test \ extra-portability.test \ extra-portability2.test \ +extra-portability3.test \ f90only.test \ flavor.test \ flibs.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index fd69a80..069ee9b 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -682,6 +682,7 @@ extra11.test \ extra12.test \ extra-portability.test \ extra-portability2.test \ +extra-portability3.test \ f90only.test \ flavor.test \ flibs.test \ diff --git a/tests/alloca2.test b/tests/alloca2.test index caf11a3..a459338 100755 --- a/tests/alloca2.test +++ b/tests/alloca2.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 2003, 2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,6 +22,7 @@ set -e cat >> configure.in <<'END' AC_PROG_CC +AM_PROG_AR END cat > Makefile.am << 'END' @@ -31,6 +32,7 @@ libtu_la_LIBADD = @LTALLOCA@ END : > alloca.c +: > ar-lib $ACLOCAL AUTOMAKE_fails diff --git a/tests/ar4.test b/tests/ar4.test index ebd8c57..bb18111 100755 --- a/tests/ar4.test +++ b/tests/ar4.test @@ -27,9 +27,13 @@ END $ACLOCAL $AUTOCONF -./configure AR=/bin/false 2>stderr && { cat stderr >&2; Exit 1; } +st=0; ./configure AR=/bin/false >stdout 2>stderr || st=$? +cat stdout cat stderr >&2 +test $st -eq 1 -grep 'configure: error: could not determine /bin/false interface' stderr +grep '^checking.* archiver .*interface.*\.\.\. unknown' stdout +grep '^configure: error: could not determine /bin/false interface' stderr +ls *conftest* && Exit 1 : diff --git a/tests/ar5.test b/tests/ar5.test index d00f421..865e0bf 100755 --- a/tests/ar5.test +++ b/tests/ar5.test @@ -21,13 +21,22 @@ set -e cat >> configure.in << 'END' -AM_PROG_AR([echo spy > bad-archiver-interface-detected]) +AM_PROG_AR([ + echo spy > bad-archiver-interface-detected + AC_MSG_CHECKING([for something else]) + AC_MSG_RESULT([found it]) + echo Grep This +]) END $ACLOCAL $AUTOCONF -./configure AR=/bin/false +./configure AR=/bin/false >stdout || { cat stdout; Exit 1; } +cat stdout +grep '^checking.* archiver .*interface.*\.\.\. unknown$' stdout +grep '^checking for something else\.\.\. found it$' stdout +grep '^Grep This$' stdout test -f bad-archiver-interface-detected : diff --git a/tests/color2.test b/tests/color2.test index 306aa04..2217d88 100755 --- a/tests/color2.test +++ b/tests/color2.test @@ -38,16 +38,31 @@ case `echo "$std" | grep .` in *) echo "$me: grep can't parse nonprinting characters" >&2; Exit 77;; esac -# Check that we have a working expect program. -cat >expect-check <<'END' -#! /usr/bin/expect -f -spawn $env(THE_SYSTEM_SHELL) -c : -expect eof +# This test requires a working a working `expect' program. +(set +e; expect -c "exit 77"; test $? -eq 77) \ + || skip_ "requires a working expect program" + +# Also, if the $MAKE program fails to consider the standard output as a +# tty (this happens with e.g., BSD make and Solaris dmake when they're +# run in parallel mode; see the autoconf manual), there is little point +# in proceeding. +cat > Makefile <<'END' +all: +## Creaive quoting in the `echo' below to avoid risk of spurious output +## matches by `expect', below. + @test -t 1 && echo "stdout" "is" "a" "tty" END -THE_SYSTEM_SHELL=/bin/sh expect -f expect-check || { - echo "$me: failed to find a working expect program" >&2 - Exit 77 +cat > expect-check <<'END' +spawn $env(MAKE) +expect { + "stdout is a tty" { exit 0 } + default { exit 1 } } +exit 1 +END +MAKE=$MAKE expect -f expect-check \ + || skip_ "make spawned by expect should have a tty stdout" +rm -f check Makefile # Do the tests. @@ -108,7 +123,6 @@ test_no_color () } cat >expect-make <<'END' -#! /usr/bin/expect -f spawn $env(MAKE) -e check expect eof END diff --git a/tests/defs.in b/tests/defs.in index b8edd3b..64bc636 100644 --- a/tests/defs.in +++ b/tests/defs.in @@ -433,11 +433,13 @@ cd ./$testSubDir echo "AC_CONFIG_FILES([Makefile])" } >configure.in -# Unset some MAKE... variables that may cause $MAKE to act like a -# recursively invoked sub-make. Any $MAKE invocation in a test is +# Unset some make-related variables that may cause $MAKE to act like +# a recursively invoked sub-make. Any $MAKE invocation in a test is # conceptually an independent invocation, not part of the main # 'automake' build. -unset MFLAGS MAKEFLAGS AM_MAKEFLAGS MAKELEVEL __MKLVL__ MAKE_JOBS_FIFO +unset MFLAGS MAKEFLAGS AM_MAKEFLAGS MAKELEVEL +unset __MKLVL__ MAKE_JOBS_FIFO # For BSD make. +unset DMAKE_CHILD DMAKE_DEF_PRINTED DMAKE_MAX_JOBS # For Solaris dmake. # Unset verbosity flag. unset V # Also unset variables that will let `make -e install' divert diff --git a/tests/distcheck-override-infodir.test b/tests/distcheck-override-infodir.test index 8c54cfb..19ad3d1 100755 --- a/tests/distcheck-override-infodir.test +++ b/tests/distcheck-override-infodir.test @@ -17,7 +17,7 @@ # Check that we can override ${infodir} while having distcheck still # working. Relate to automake bug#9579. -required='makeinfo tex texi2dvi' +required='makeinfo tex texi2dvi install-info' . ./defs || Exit 1 set -e diff --git a/tests/dollarvar2.test b/tests/dollarvar2.test index 6fc2737..7a6db37 100755 --- a/tests/dollarvar2.test +++ b/tests/dollarvar2.test @@ -21,6 +21,11 @@ set -e +# +# First, try a setup where we have a `portability-recursive' warning, +# but no "simple" `portability' warning. +# + cat >Makefile.am <<'EOF' x = 1 bla = $(foo$(x)) @@ -28,11 +33,61 @@ EOF $ACLOCAL -# $AUTOMAKE already contains -Wall -Werror. -AUTOMAKE_fails -Wportability -$AUTOMAKE --force -Wno-all -$AUTOMAKE --force -Wno-portability +# Enabling `portability' warnings should enable `portability-recursive' +# warnings. +AUTOMAKE_fails -Wnone -Wportability +grep 'recursive variable expansion' stderr +# `portability-recursive' warnings can be enabled by themselves. +AUTOMAKE_fails -Wnone -Wportability-recursive +grep 'recursive variable expansion' stderr + +# Various ways to disable `portability-recursive'. +$AUTOMAKE -Wno-all +$AUTOMAKE -Wno-portability +$AUTOMAKE -Wall -Wno-portability-recursive + +# `-Wno-portability-recursive' after `-Wportability' correctly disables +# `portability-recursive' warnings. +$AUTOMAKE -Wportability -Wno-portability-recursive + +# `-Wno-portability' disables `portability-recursive' warnings; but +# a later `-Wportability-recursive' re-enables them. This time, we +# use AUTOMAKE_OPTIONS to specify the warning levels. echo 'AUTOMAKE_OPTIONS = -Wno-portability' >> Makefile.am -$AUTOMAKE --force +$AUTOMAKE +echo 'AUTOMAKE_OPTIONS += -Wportability-recursive' >> Makefile.am +AUTOMAKE_fails +grep 'recursive variable expansion' stderr + +# +# Now try a setup where we have both a `portability' warning and +# a `portability-recursive' one. +# + +cat >Makefile.am <<'EOF' +x = 1 +bla = $(foo$(x)) +noinst_PROGRAMS = foo +foo_CPPFLAGS = -Dwhatever +EOF + +echo AC_PROG_CC >> configure.in + +$ACLOCAL --force + +# Can disable both `portability' and `portability-recursive' warnings. +$AUTOMAKE -Wno-portability + +# Disabling `portability-recursive' warnings should not disable +# `portability' warnings. +AUTOMAKE_fails -Wportability -Wno-portability-recursive +grep AM_PROG_CC_C_O stderr +grep 'recursive variable expansion' stderr && Exit 1 + +# Enabling `portability-recursive' warnings should not enable +# all the `portability' warning. +AUTOMAKE_fails -Wno-portability -Wportability-recursive +grep AM_PROG_CC_C_O stderr && Exit 1 +grep 'recursive variable expansion' stderr : diff --git a/tests/extra-portability.test b/tests/extra-portability.test index ce833b4..62a6335 100755 --- a/tests/extra-portability.test +++ b/tests/extra-portability.test @@ -24,18 +24,34 @@ set -e +# We want (almost) complete control over automake options. +# FIXME: use $original_AUTOMAKE here once we are merged into master. +AUTOMAKE="`(set $AUTOMAKE && echo $1)` --foreign -Werror" + cat >>configure.in <<END AC_PROG_CC AC_PROG_RANLIB AC_OUTPUT END +$ACLOCAL + +# +# First, a setup where only an extra-portability warning is present +# (no "simple" portability-warnings are). +# + cat >Makefile.am <<END EXTRA_LIBRARIES = libfoo.a libfoo_a_SOURCES = sub/foo.c END -$ACLOCAL +# Sanity check: extra-portability warnings causes the expected error. +AUTOMAKE_fails -Wextra-portability +grep 'requires.*AM_PROG_AR' stderr + +# Warnings in extra-portability category are not enabled by default. +$AUTOMAKE # `-Wall' does not enable extra-portability warnings. $AUTOMAKE -Wall -Werror @@ -66,10 +82,7 @@ grep 'requires.*AM_PROG_CC_C_O' stderr grep 'requires.*AM_PROG_AR' stderr # Disabling extra-portability leaves portability intact. -AUTOMAKE_fails -Wno-extra-portability -# The expected diagnostic is -# Makefile.am:2: compiling `foo.c' with per-target flags requires `AM_PROG_CC_C_O' in `configure.in' -# Makefile.am:1: while processing library `libfoo.a' +AUTOMAKE_fails -Wportability -Wno-extra-portability grep 'requires.*AM_PROG_CC_C_O' stderr grep 'requires.*AM_PROG_AR' stderr && Exit 1 @@ -81,14 +94,12 @@ grep 'requires.*AM_PROG_AR' stderr && Exit 1 # Enabling portability does not enable extra-portability. AUTOMAKE_fails -Wnone -Wportability -# The expected diagnostic is -# Makefile.am:2: compiling `foo.c' with per-target flags requires `AM_PROG_CC_C_O' in `configure.in' -# Makefile.am:1: while processing library `libfoo.a' grep 'requires.*AM_PROG_CC_C_O' stderr grep 'requires.*AM_PROG_AR' stderr && Exit 1 # Disabling portability disables extra-portability. $AUTOMAKE -Wno-portability $AUTOMAKE -Wextra-portability -Wno-portability +$AUTOMAKE -Wall -Wno-portability : diff --git a/tests/extra-portability3.test b/tests/extra-portability3.test new file mode 100755 index 0000000..7ca19b1 --- /dev/null +++ b/tests/extra-portability3.test @@ -0,0 +1,63 @@ +#! /bin/sh +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Check interactions between the `portability-recursive' and +# `extra-portability' warning categories. + +. ./defs || Exit 1 + +set -e + +# We want (almost) complete control over automake options. +# FIXME: use $original_AUTOMAKE here once we are merged into master. +AUTOMAKE="`(set $AUTOMAKE && echo $1)` --foreign -Werror" + +cat >>configure.in <<END +AC_PROG_CC +AC_PROG_RANLIB +AC_OUTPUT +END + +$ACLOCAL + +cat >Makefile.am <<'END' +baz = $(foo$(bar)) +lib_LIBRARIES = libfoo.a +libfoo_a_SOURCES = foo.c +END + +# 'extra-portability' implies 'portability-recursive'. +AUTOMAKE_fails -Wextra-portability +grep 'requires.*AM_PROG_AR' stderr +grep 'recursive variable expansion' stderr + +# We can disable 'extra-portability' while leaving +# 'portability-recursive' intact. +AUTOMAKE_fails -Wportability-recursive -Wno-extra-portability +grep 'requires.*AM_PROG_AR' stderr && Exit 1 +grep 'recursive variable expansion' stderr + +# We can disable 'portability-recursive' while leaving +# 'extra-portability' intact. +AUTOMAKE_fails -Wextra-portability -Wno-portability-recursive +grep 'requires.*AM_PROG_AR' stderr +grep 'recursive variable expansion' stderr && Exit 1 + +# Disabling 'portability' disables 'portability-recursive' and +# 'extra-portability'. +$AUTOMAKE -Wextra-portability -Wno-portability + +: diff --git a/tests/ldadd.test b/tests/ldadd.test index 7f4fce8..3515a4e 100755 --- a/tests/ldadd.test +++ b/tests/ldadd.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1997, 1999, 2000, 2001, 2002, 2010 Free Software +# Copyright (C) 1997, 1999, 2000, 2001, 2002, 2010, 2011 Free Software # Foundation, Inc. # # This program is free software; you can redistribute it and/or modify @@ -42,6 +42,7 @@ END : > q.c $ACLOCAL || Exit 1 -AUTOMAKE_fails -grep LDADD stderr || Exit 1 +AUTOMAKE_fails -Wno-extra-portability +grep "libtu_la_LDADD" stderr +grep " use [\`"']libtu_la_LIBADD' stderr Exit 0 diff --git a/tests/libtool4.test b/tests/libtool4.test index 9f6a730..814b537 100755 --- a/tests/libtool4.test +++ b/tests/libtool4.test @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2002, 2003 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,12 +22,15 @@ set -e cat >> configure.in <<'END' AC_PROG_CC +AM_PROG_AR END cat > Makefile.am << 'END' EXTRA_LTLIBRARIES = liblib.la END +: > ar-lib + $ACLOCAL AUTOMAKE_fails grep '[Ll]ibtool library .*LIBTOOL.* undefined' stderr diff --git a/tests/ltinit.test b/tests/ltinit.test index 8b76bdf..58f1926 100755 --- a/tests/ltinit.test +++ b/tests/ltinit.test @@ -56,7 +56,7 @@ $AUTOMAKE -a cwd=`pwd` ./configure --prefix="$cwd/inst" >stdout || { cat stdout; Exit 1; } cat stdout -grep '^checking.*dlopen' stdout +grep '^checking.*dlfcn\.h.* no$' stdout || grep '^checking.*dlopen' stdout $MAKE $MAKE install diff --git a/tests/pr211.test b/tests/pr211.test index 6778f7a..798e4f6 100755 --- a/tests/pr211.test +++ b/tests/pr211.test @@ -47,7 +47,7 @@ END libtoolize $ACLOCAL -AUTOMAKE_fails -a +AUTOMAKE_fails -Wnone -a $FGREP 'foo.$(OBJEXT)' stderr : diff --git a/tests/reqd2.test b/tests/reqd2.test index b47ef15..1bf8123 100755 --- a/tests/reqd2.test +++ b/tests/reqd2.test @@ -29,6 +29,7 @@ AC_CONFIG_AUX_DIR([autoconf]) AM_INIT_AUTOMAKE AC_CONFIG_FILES([Makefile]) AC_PROG_CC +AM_PROG_AR AM_PROG_LIBTOOL AC_CONFIG_FILES([autoconf/Makefile main/Makefile]) AC_OUTPUT @@ -45,6 +46,7 @@ lib_LTLIBRARIES = lib0.la lib0_la_SOURCES = 0.c END +: > ar-lib libtoolize --force --copy $ACLOCAL $AUTOCONF @@ -52,4 +54,6 @@ $AUTOCONF test -f autoconf/ltmain.sh # Sanity check. rm -f autoconf/ltmain.sh AUTOMAKE_fails --add-missing --copy -grep 'autoconf/ltmain.sh' stderr +grep '^configure\.in:7:.* required file.*autoconf/ltmain\.sh' stderr + +: diff --git a/tests/syntax.test b/tests/syntax.test index 505486f..23fa792 100755 --- a/tests/syntax.test +++ b/tests/syntax.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc. +# Copyright (C) 1998, 2001, 2002, 2003, 2011 Free Software Foundation, +# Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,9 +24,11 @@ set -e cat > Makefile.am << 'END' foo = q \ -lib_LTLIBRARIES = foo.la +bin_SCRIPTS = foo.sh END $ACLOCAL -AUTOMAKE_fails -grep 'Makefile.am:2:.*blank line' stderr +AUTOMAKE_fails -Wnone +grep '^Makefile\.am:2:.*blank line following trailing backslash' stderr + +: diff --git a/tests/uninstall-fail.test b/tests/uninstall-fail.test index 14a843b..a4a058a 100755 --- a/tests/uninstall-fail.test +++ b/tests/uninstall-fail.test @@ -27,7 +27,19 @@ set -e mkdir d : > d/f chmod a-w d || skip "cannot make directories unwritable" -rm -f d/f && skip_ "can delete files from unwritable directories" + +# On Solaris 10, if `/bin/rm' is run with the `-f' option, it doesn't +# print any error message when failing to remove a file (due to e.g., +# "Permission denied"). Yikes. We'll cater to this incompatibility +# by relaxing a test below if a faulty `rm' is detected. +st=0; rm -f d/f 2>stderr || st=$? +cat stderr >&2 +test $st -gt 0 || skip_ "can delete files from unwritable directories" +if grep 'rm:' stderr; then + rm_f_is_silent_on_error=no +else + rm_f_is_silent_on_error=yes +fi cat >> configure.in << 'END' AC_OUTPUT @@ -53,7 +65,11 @@ mkdir $inst $inst/share chmod a-w $inst/share $MAKE uninstall >output 2>&1 && { cat output; Exit 1; } cat output -grep "rm: .*foobar\.txt" output +if test $rm_f_is_silent_on_failure = yes; then + : "rm -f" is silent on errors, skip the grepping of make output +else + grep "rm: .*foobar\.txt" output +fi chmod a-rwx $inst/share (cd $inst/share) && skip_ "cannot make directories fully unreadable"