Hello automakers. As a follow-up to the patch suggested by Jeff A. Daily: <http://lists.gnu.org/archive/html/automake/2010-09/msg00029.html> I'd like to use AS_HELP_STRING more consistently in the Automake-provided macros. To do that confidently, I'd like to increase the testsuite coverage a little first. This is what the attached patch is meant to do.
OK for maint? Regards, Stefano
From bc41d61ebadfe2c3809ee91086464faf35e26903 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Wed, 15 Sep 2010 21:43:56 +0200 Subject: [PATCH] Test automake-generated portions of configure help screen. * tests/help-depend.test: New test. * tests/help-depend2.test: Likewise. * tests/help-dmalloc.test: Likewise. * tests/help-init.test: Likewise. * tests/help-lispdir.test: Likewise. * tests/help-maintainer.test: Likewise. * tests/help-multilib.test: Likewise. * tests/help-regex.test: Likewise. * tests/help-silent.test: Likewise. * tests/help-upc.test: Likewise. * tests/mmode.test: Remove tests on `configure --help' output, they are supersed by tests in `help-maintainer.test'. * tests/Makefile.am (TESTS): Update. --- ChangeLog | 17 +++++++++++++ tests/Makefile.am | 10 +++++++ tests/Makefile.in | 10 +++++++ tests/help-depend.test | 41 +++++++++++++++++++++++++++++++ tests/help-depend2.test | 42 +++++++++++++++++++++++++++++++ tests/help-dmalloc.test | 39 +++++++++++++++++++++++++++++ tests/help-init.test | 39 +++++++++++++++++++++++++++++ tests/help-lispdir.test | 40 ++++++++++++++++++++++++++++++ tests/help-maintainer.test | 58 ++++++++++++++++++++++++++++++++++++++++++++ tests/help-multilib.test | 38 ++++++++++++++++++++++++++++ tests/help-regex.test | 38 ++++++++++++++++++++++++++++ tests/help-silent.test | 43 ++++++++++++++++++++++++++++++++ tests/help-upc.test | 38 ++++++++++++++++++++++++++++ tests/mmode.test | 5 +-- 14 files changed, 455 insertions(+), 3 deletions(-) create mode 100755 tests/help-depend.test create mode 100755 tests/help-depend2.test create mode 100755 tests/help-dmalloc.test create mode 100755 tests/help-init.test create mode 100755 tests/help-lispdir.test create mode 100755 tests/help-maintainer.test create mode 100755 tests/help-multilib.test create mode 100755 tests/help-regex.test create mode 100755 tests/help-silent.test create mode 100755 tests/help-upc.test diff --git a/ChangeLog b/ChangeLog index 7b64d55..f5f7a9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2010-09-15 Stefano Lattarini <stefano.lattar...@gmail.com> + + Test automake-generated portions of configure help screen. + * tests/help-depend.test: New test. + * tests/help-depend2.test: Likewise. + * tests/help-dmalloc.test: Likewise. + * tests/help-init.test: Likewise. + * tests/help-lispdir.test: Likewise. + * tests/help-maintainer.test: Likewise. + * tests/help-multilib.test: Likewise. + * tests/help-regex.test: Likewise. + * tests/help-silent.test: Likewise. + * tests/help-upc.test: Likewise. + * tests/mmode.test: Remove tests on `configure --help' output, + they are supersed by tests in `help-maintainer.test'. + * tests/Makefile.am (TESTS): Update. + 2010-09-13 Ralf Wildenhues <ralf.wildenh...@gmx.de> * HACKING: Hint at old commits with `git describe' output. diff --git a/tests/Makefile.am b/tests/Makefile.am index 58103cc..ba695f5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -348,6 +348,16 @@ gnits2.test \ gnits3.test \ header.test \ help.test \ +help-depend.test \ +help-depend2.test \ +help-dmalloc.test \ +help-init.test \ +help-lispdir.test \ +help-maintainer.test \ +help-multilib.test \ +help-regex.test \ +help-silent.test \ +help-upc.test \ hfs.test \ hosts.test \ implicit.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index e967caa..9ea9d74 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -586,6 +586,16 @@ gnits2.test \ gnits3.test \ header.test \ help.test \ +help-depend.test \ +help-depend2.test \ +help-dmalloc.test \ +help-init.test \ +help-lispdir.test \ +help-maintainer.test \ +help-multilib.test \ +help-regex.test \ +help-silent.test \ +help-upc.test \ hfs.test \ hosts.test \ implicit.test \ diff --git a/tests/help-depend.test b/tests/help-depend.test new file mode 100755 index 0000000..ed9447e --- /dev/null +++ b/tests/help-depend.test @@ -0,0 +1,41 @@ +#! /bin/sh +# Copyright (C) 2010 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 private macro `AM_DEP_TRACK' adds proper text to +# the configure help screen. +# Keep this in sync with sister test `help-depend2.test' + +. ./defs || Exit 1 + +set -e + +cat > configure.in <<END +AC_INIT([$me], [1.0]) +AM_DEP_TRACK +END + +$ACLOCAL +$AUTOCONF + +./configure --help >stdout || { cat stdout; Exit 1; } +cat stdout + +$FGREP ' --enable-dependency-tracking ' stdout +$FGREP ' --disable-dependency-tracking ' stdout +$FGREP ' one-time build' stdout +$FGREP ' slow dependency extract' stdout + +: diff --git a/tests/help-depend2.test b/tests/help-depend2.test new file mode 100755 index 0000000..b4133b4 --- /dev/null +++ b/tests/help-depend2.test @@ -0,0 +1,42 @@ +#! /bin/sh +# Copyright (C) 2010 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 when automake automatically activates support for +# dependency tracking, it adds proper text to the configure help screen. +# Keep this in sync with sister test `help-depend.test' + +. ./defs || Exit 1 + +set -e + +cat > configure.in <<END +AC_INIT([$me], [1.0]) +AM_INIT_AUTOMAKE +AC_PROG_CC +END + +$ACLOCAL +$AUTOCONF + +./configure --help >stdout || { cat stdout; Exit 1; } +cat stdout + +$FGREP ' --enable-dependency-tracking ' stdout +$FGREP ' --disable-dependency-tracking ' stdout +$FGREP ' one-time build' stdout +$FGREP ' slow dependency extract' stdout + +: diff --git a/tests/help-dmalloc.test b/tests/help-dmalloc.test new file mode 100755 index 0000000..c20288d --- /dev/null +++ b/tests/help-dmalloc.test @@ -0,0 +1,39 @@ +#! /bin/sh +# Copyright (C) 2010 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_WITH_DMALLOC' adds proper text to +# the configure help screen. + +. ./defs || Exit 1 + +set -e + +cat > configure.in <<END +AC_INIT([$me], [1.0]) +AM_WITH_DMALLOC +END + +$ACLOCAL +$AUTOCONF + +./configure --help >stdout || { cat stdout; Exit 1; } +cat stdout + +$FGREP ' --with-dmalloc ' stdout +$FGREP ' use dmalloc' stdout +$FGREP 'www.dmalloc.com' stdout + +: diff --git a/tests/help-init.test b/tests/help-init.test new file mode 100755 index 0000000..a3af271 --- /dev/null +++ b/tests/help-init.test @@ -0,0 +1,39 @@ +#! /bin/sh +# Copyright (C) 2010 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 grand macro `AM_INIT_AUTOMAKE' add proper text +# to the configure help screen. + +. ./defs || Exit 1 + +set -e + +cat > configure.in <<END +AC_INIT([$me], [1.0]) +AM_INIT_AUTOMAKE +END + +$ACLOCAL +$AUTOCONF + +./configure --help >stdout || { cat stdout; Exit 1; } +cat stdout + +grep ' --program-prefix[= ]' stdout +grep ' --program-suffix[= ]' stdout +grep ' --program-transform-name[= ]' stdout + +: diff --git a/tests/help-lispdir.test b/tests/help-lispdir.test new file mode 100755 index 0000000..3d82074 --- /dev/null +++ b/tests/help-lispdir.test @@ -0,0 +1,40 @@ +#! /bin/sh +# Copyright (C) 2010 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_PATH_LISPDIR' adds proper text to +# the configure help screen. + +. ./defs || Exit 1 + +set -e + +cat > configure.in <<END +AC_INIT([$me], [1.0]) +AM_PATH_LISPDIR +END + +$ACLOCAL +$AUTOCONF + +./configure --help >stdout || { cat stdout; Exit 1; } +cat stdout + +grep ' --with-lispdir .*override.*lisp directory' stdout +grep ' EMACS .*[eE]macs editor' stdout +grep ' EMACSLOADPATH' stdout +grep ' .*[eE]macs library search path' stdout + +: diff --git a/tests/help-maintainer.test b/tests/help-maintainer.test new file mode 100755 index 0000000..72fc98a --- /dev/null +++ b/tests/help-maintainer.test @@ -0,0 +1,58 @@ +#! /bin/sh +# Copyright (C) 2010 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 + +set -e + +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 +grep ' --enable-maintainer-mode.*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 +grep ' --enable-maintainer-mode.*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 +grep ' --disable-maintainer-mode.*disable make rules' stdout + +: diff --git a/tests/help-multilib.test b/tests/help-multilib.test new file mode 100755 index 0000000..0016c76 --- /dev/null +++ b/tests/help-multilib.test @@ -0,0 +1,38 @@ +#! /bin/sh +# Copyright (C) 2010 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_ENABLE_MULTILIB' adds proper text to +# the configure help screen. + +. ./defs || Exit 1 + +set -e + +cat > configure.in <<END +AC_INIT([$me], [1.0]) +AM_ENABLE_MULTILIB +END + +$ACLOCAL +$AUTOCONF + +./configure --help >stdout || { cat stdout; Exit 1; } +cat stdout + +$FGREP ' --enable-multilib ' stdout +$FGREP ' many library versions (default)' stdout + +: diff --git a/tests/help-regex.test b/tests/help-regex.test new file mode 100755 index 0000000..3eff5f9 --- /dev/null +++ b/tests/help-regex.test @@ -0,0 +1,38 @@ +#! /bin/sh +# Copyright (C) 2010 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 obsolescent macro `AM_WITH_REGEX' adds proper text to +# the configure help screen. + +. ./defs || Exit 1 + +set -e + +cat > configure.in <<END +AC_INIT([$me], [1.0]) +AM_WITH_REGEX +END + +$ACLOCAL +$AUTOCONF + +./configure --help >stdout || { cat stdout; Exit 1; } +cat stdout + +$FGREP ' --without-regex ' stdout +$FGREP ' use GNU rx ' stdout + +: diff --git a/tests/help-silent.test b/tests/help-silent.test new file mode 100755 index 0000000..b338907 --- /dev/null +++ b/tests/help-silent.test @@ -0,0 +1,43 @@ +#! /bin/sh +# Copyright (C) 2010 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_SILENT_RULES' adds proper text to +# the configure help screen. + +. ./defs || Exit 1 + +set -e + +cat > configure.in <<END +AC_INIT([$me], [1.0]) +AM_SILENT_RULES +END + +$ACLOCAL + +mv -f configure.in configure.tmpl + +for args in '' '([])' '([yes])' '([no])'; do + sed "s/AM_SILENT_RULES.*/&$args/" configure.tmpl >configure.in + cat configure.in + $AUTOCONF --force + ./configure --help >stdout || { cat stdout; Exit 1; } + cat stdout + grep ' --enable-silent-rules *less verbose build.*undo.*make V=1' stdout + grep ' --disable-silent-rules *verbose build.*undo.*make V=0' stdout +done + +: diff --git a/tests/help-upc.test b/tests/help-upc.test new file mode 100755 index 0000000..586299b --- /dev/null +++ b/tests/help-upc.test @@ -0,0 +1,38 @@ +#! /bin/sh +# Copyright (C) 2010 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_PROG_UPC' adds proper text to +# the configure help screen. + +. ./defs || Exit 1 + +set -e + +cat > configure.in <<END +AC_INIT([$me], [1.0]) +AM_PROG_UPC +END + +$ACLOCAL +$AUTOCONF + +./configure --help >stdout || { cat stdout; Exit 1; } +cat stdout + +grep ' UPCFLAGS .*Unified Parallel C compiler flags' stdout +grep ' UPC .*Unified Parallel C compiler command' stdout + +: diff --git a/tests/mmode.test b/tests/mmode.test index 19f83f1..c5a16c9 100755 --- a/tests/mmode.test +++ b/tests/mmode.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2008 Free Software Foundation, Inc. +# Copyright (C) 2008, 2010 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 @@ -31,7 +31,6 @@ $ACLOCAL $AUTOCONF $AUTOMAKE -a -./configure --help | grep 'enable-maintainer-mode.*enable make rules' ./configure grep '^MAINT.*#' Makefile @@ -51,7 +50,6 @@ sed 's/\(AM_MAINTAINER_MODE\).*/\1([enable])/' configure.in > configure.int mv -f configure.int configure.in $AUTOCONF --force -./configure --help | grep 'disable-maintainer-mode.*disable make rules' ./configure grep '^MAINT.*#' Makefile && Exit 1 @@ -64,4 +62,5 @@ grep '^MAINT.*#' Makefile sed 's/\(AM_MAINTAINER_MODE\).*/\1([foo])/' configure.in > configure.int mv -f configure.int configure.in $AUTOCONF --force -Werror && Exit 1 + : -- 1.7.1