diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2011-11-03 11:37:30 +0100 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2011-11-03 11:37:30 +0100 |
commit | a778e9e1dcf606c9cee31009c982daa748438b39 (patch) | |
tree | 9216fc3c0555f30f35aa484dd36158f182ca9c9d /tests | |
parent | 8c695f69de9a6d8114ca3672de5ad303faa2c700 (diff) | |
parent | 1ba50d12baadb27e463c6e6c73bf19ddd53c65e4 (diff) | |
download | automake-a778e9e1dcf606c9cee31009c982daa748438b39.tar.gz |
Merge branch 'maint'
* maint:
maint-mode: fix botched configure messages
fix: regenerate Makefiles
info: allow user to inhibit creation/update of '${infodir}/dir'
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 3 | ||||
-rw-r--r-- | tests/Makefile.in | 3 | ||||
-rwxr-xr-x | tests/help-maintainer.test | 59 | ||||
-rwxr-xr-x | tests/install-info-dir.test | 140 | ||||
-rwxr-xr-x | tests/maintmode-configure-msg.test | 79 |
5 files changed, 223 insertions, 61 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 4c04f1e2a..d900b41b9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -509,7 +509,6 @@ help-depend2.test \ help-dmalloc.test \ help-init.test \ help-lispdir.test \ -help-maintainer.test \ help-multilib.test \ help-python.test \ help-regex.test \ @@ -524,6 +523,7 @@ init2.test \ insh2.test \ install2.test \ installdir.test \ +install-info-dir.test \ instsh.test \ instsh2.test \ instsh3.test \ @@ -657,6 +657,7 @@ lzma.test \ m4-inclusion.test \ maintclean.test \ maintclean-vpath.test \ +maintmode-configure-msg.test \ make.test \ makej.test \ makej2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 704ae4471..e1f91d039 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -785,7 +785,6 @@ help-depend2.test \ help-dmalloc.test \ help-init.test \ help-lispdir.test \ -help-maintainer.test \ help-multilib.test \ help-python.test \ help-regex.test \ @@ -800,6 +799,7 @@ init2.test \ insh2.test \ install2.test \ installdir.test \ +install-info-dir.test \ instsh.test \ instsh2.test \ instsh3.test \ @@ -933,6 +933,7 @@ lzma.test \ m4-inclusion.test \ maintclean.test \ maintclean-vpath.test \ +maintmode-configure-msg.test \ make.test \ makej.test \ makej2.test \ diff --git a/tests/help-maintainer.test b/tests/help-maintainer.test deleted file mode 100755 index a4b2d8521..000000000 --- a/tests/help-maintainer.test +++ /dev/null @@ -1,59 +0,0 @@ -#! /bin/sh -# Copyright (C) 2010, 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/>. - -# Make sure that our macro `AM_MAINTAINER_MODE' adds proper text to -# the configure help screen. - -. ./defs || Exit 1 - -cat > configure.in <<END -AC_INIT([$me], [1.0]) -AM_MAINTAINER_MODE -END - -cat configure.in -$ACLOCAL -$AUTOCONF --force -./configure --help >stdout || { cat stdout; Exit 1; } -cat stdout -$EGREP '^ *--enable-maintainer-mode( |$)' stdout -$FGREP ' enable make rules' stdout - -rm -rf autom4te*.cache # just to be sure -sed 's/\(AM_MAINTAINER_MODE\).*/\1([disable])/' configure.in >t -mv -f t configure.in - -cat configure.in -$ACLOCAL -$AUTOCONF --force -./configure --help >stdout || { cat stdout; Exit 1; } -cat stdout -$EGREP '^ *--enable-maintainer-mode( |$)' stdout -$FGREP ' enable make rules' stdout - -rm -rf autom4te*.cache # just to be sure -sed 's/\(AM_MAINTAINER_MODE\).*/\1([enable])/' configure.in >t -mv -f t configure.in - -cat configure.in -$ACLOCAL -$AUTOCONF --force -./configure --help >stdout || { cat stdout; Exit 1; } -cat stdout -$EGREP '^ *--disable-maintainer-mode( |$)' stdout -$FGREP ' disable make rules' stdout - -: diff --git a/tests/install-info-dir.test b/tests/install-info-dir.test new file mode 100755 index 000000000..f75b11538 --- /dev/null +++ b/tests/install-info-dir.test @@ -0,0 +1,140 @@ +#! /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/>. + +# Checks on the `install-info' target. +# Details about the individual checks' purposes and motivations are +# inlined, below. + +# FIXME: this test is a good candidate for a conversion to TAP, +# FIXME: and could be merged with `txinfo27.test'. + +required=makeinfo +. ./defs || Exit 1 + +cwd=`pwd` || fatal_ "cannot get current working directory" + +mkdir bin +saved_PATH=$PATH; export saved_PATH +PATH=$cwd/bin$PATH_SEPARATOR$PATH; export PATH + +set -e + +cat >> configure.in <<'END' +AC_OUTPUT +END + +cat > Makefile.am << 'END' +info_TEXINFOS = foo.texi +END + +cat > foo.texi << 'END' +\input texinfo +@setfilename foo.info +@node Top +Hello world! +@bye +END + +$ACLOCAL +$AUTOMAKE -a +$AUTOCONF + +instdir=_inst +destdir=_dest + +./configure --prefix="$cwd/$instdir" --infodir="$cwd/$instdir/info" + +$MAKE info +test -f foo.info + +if install-info --version; then + have_installinfo=yes +else + have_installinfo=no +fi + +# The `install-info' target updates the `${infodir}/dir' file +# by default (if the `install-info' program is available). +# This should happen in a normal as well as in a DESTDIR installation. +if test $have_installinfo = yes; then + $MAKE install-info + test -f $instdir/info/foo.info + test -f $instdir/info/dir + $MAKE DESTDIR="$cwd/$destdir" install-info + test -f "$destdir/$cwd/$instdir"/info/foo.info + test -f "$destdir/$cwd/$instdir"/info/dir +fi + +rm -rf $instdir $destdir + +# The `install-info' target doesn't fail if the `install-info' +# program is not available. +cat > bin/install-info <<'END' +#!/bin/sh +echo error from install-info >&2 +exit 127 +END +chmod a+x bin/install-info +$MAKE install-info >output 2>&1 || { cat output; Exit 1; } +cat output +test -f $instdir/info/foo.info +test ! -f $instdir/info/dir +grep 'error from install-info' output && Exit 1 + +rm -rf $instdir output + +if test $have_installinfo = yes; then + # The `install-info' target doesn't try to guess whether the `install-info' + # is the GNU or debian version. + unindent > bin/install-info <<'END' + #!/bin/sh + set -e; set -u; + for fd in 1 2; do + for str in dpkg debian Debian; do + eval "echo This is $str install-info >&$fd" + done + done + PATH=$saved_PATH; export PATH + exec install-info ${1+"$@"} +END + $MAKE install-info + test -f $instdir/info/foo.info + test -f $instdir/info/dir +fi + +rm -rf $instdir bin/install-info + +# The `AM_UPDATE_INFO_DIR' environment variable can be used to +# prevent the creation or update of the `${infodir}/dir' file, +# if set to a "no" value. +for val in no NO n; do + rm -rf $instdir + env AM_UPDATE_INFO_DIR="$val" $MAKE install-info + test -f $instdir/info/foo.info + test ! -f $instdir/info/dir +done +if test $have_installinfo = yes; then + for val in 'yes' 'who cares!'; do + rm -rf $instdir + env AM_UPDATE_INFO_DIR="$val" $MAKE install-info + test -f $instdir/info/foo.info + test -f $instdir/info/dir + done +fi + +rm -rf $instdir + +: diff --git a/tests/maintmode-configure-msg.test b/tests/maintmode-configure-msg.test new file mode 100755 index 000000000..5771392c8 --- /dev/null +++ b/tests/maintmode-configure-msg.test @@ -0,0 +1,79 @@ +#! /bin/sh +# Copyright (C) 2010, 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/>. + +# Make sure that our macro `AM_MAINTAINER_MODE' adds proper text to +# the configure help screen. Also make sure the "checking ..." messages +# related to the enabling/disabling of maintainer mode are correct (see +# automake bug#9890). + +. ./defs || Exit 1 + +set -e + +set_maintmode () +{ + rm -rf autom4te*.cache # Just to be sure not to use a stale cache. + echo "AC_INIT([$me], [1.0])" > configure.in + case $1 in + DEFAULT) echo AM_MAINTAINER_MODE;; + *) echo "AM_MAINTAINER_MODE([$*])";; + esac >> configure.in +} + +check_configure_message_with () +{ + answer=$1; shift + ./configure ${1+"$@"} >stdout || { cat stdout; Exit 1; } + cat stdout + grep "^checking whether to enable maintainer-specific.*\\.\\.\\. $answer$" stdout + test `grep -c 'checking.*maint' stdout` -eq 1 + : +} + +set_maintmode "DEFAULT" + +$ACLOCAL + +$AUTOCONF --force + +./configure --help >stdout || { cat stdout; Exit 1; } +cat stdout +grep '^ *--enable-maintainer-mode.* enable make rules' stdout + +check_configure_message_with "no" +check_configure_message_with "yes" --enable-maintainer-mode + +set_maintmode "disable" + +$AUTOCONF --force +./configure --help >stdout || { cat stdout; Exit 1; } +cat stdout +grep '^ *--enable-maintainer-mode.* enable make rules' stdout + +check_configure_message_with "no" +check_configure_message_with "yes" --enable-maintainer-mode + +set_maintmode "enable" + +$AUTOCONF --force +./configure --help >stdout || { cat stdout; Exit 1; } +cat stdout +grep '^ *--disable-maintainer-mode.* disable make rules' stdout + +check_configure_message_with "yes" +check_configure_message_with "no" --disable-maintainer-mode + +: |