automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1.11-1544-g8c9642a
Date: Sat, 05 Nov 2011 11:23:14 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=8c9642ae03de2291717a327f977b54414e02d7cd

The branch, testsuite-work has been updated
       via  8c9642ae03de2291717a327f977b54414e02d7cd (commit)
       via  97cbf15b81c6276cb76eefce4cb15c88e12f9a47 (commit)
       via  8355b2b59221c58b33d686a0a2b4f22a19a3c330 (commit)
       via  db93b31d81c7809e49fa874acfd5e3aa3504dc48 (commit)
       via  f23d5a15269c722c8cd136827a3b021a29814cb0 (commit)
      from  8847af0bdaf45429ce32ac13f4201073ffe0d6ee (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8c9642ae03de2291717a327f977b54414e02d7cd
Merge: 8847af0 97cbf15
Author: Stefano Lattarini <address@hidden>
Date:   Sat Nov 5 11:52:55 2011 +0100

    Merge branch 'master' into testsuite-work
    
    Commits merged from master:
     - test defs: new functions to analyze configure help screen
     - warnings: fix buglets for portability warnings
     - tests: extend tests on 'extra-portability' warning category
    
    Extra edits to the testsuite:
    * tests/extra-portability.test: Use `$am_original_AUTOMAKE'
    instead of the obsolete `$original_AUTOMAKE'.
    * tests/extra-portability3.test: Likewise.
    * tests/list-of-tests.mk: Update.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                            |   61 ++++++++
 lib/Automake/ChannelDefs.pm          |   38 ++++-
 tests/Makefile.in                    |    2 +
 tests/defs                           |   48 ++++++
 tests/dollarvar2.test                |   65 ++++++++-
 tests/extra-portability.test         |   63 ++++++--
 tests/extra-portability3.test        |   62 ++++++++
 tests/help-depend.test               |   10 +-
 tests/help-depend2.test              |   10 +-
 tests/help-dmalloc.test              |    7 +-
 tests/help-init.test                 |    6 +-
 tests/help-lispdir.test              |    9 +-
 tests/help-multilib.test             |    6 +-
 tests/help-python.test               |    5 +-
 tests/help-regex.test                |    7 +-
 tests/help-silent.test               |   12 +-
 tests/help-upc.test                  |    7 +-
 tests/list-of-tests.mk               |    2 +
 tests/maintmode-configure-msg.test   |   10 +-
 tests/self-check-configure-help.test |  274 ++++++++++++++++++++++++++++++++++
 20 files changed, 616 insertions(+), 88 deletions(-)
 create mode 100755 tests/extra-portability3.test
 create mode 100755 tests/self-check-configure-help.test

diff --git a/ChangeLog b/ChangeLog
index 4e1efcc..04f3372 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,64 @@
+2011-11-05  Stefano Lattarini  <address@hidden>
+
+       Merge branch 'master' into testsuite-work
+       * tests/extra-portability.test: Use `$am_original_AUTOMAKE'
+       instead of the obsolete `$original_AUTOMAKE'.
+       * tests/extra-portability3.test: Likewise.
+       * tests/list-of-tests.mk: Update.
+
+2011-11-05  Stefano Lattarini  <address@hidden>
+
+       Merge branch 'msvc' into master
+       * tests/extra-portability3.test: Use `$original_AUTOMAKE' instead
+       of hackishly extracting the first component of `$AUTOMAKE'.
+       * tests/extra-portability.test: Likewise.  Also, since we are at
+       it, throw in a couple of small extensions and tweakings (suggested
+       by the minor merge conflicts).
+
+2011-11-04  Stefano Lattarini  <address@hidden>
+
+       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  <address@hidden>
+
+       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-04  Stefano Lattarini  <address@hidden>
+
+       test defs: new functions to analyze configure help screen
+       * tests/defs (extract_configure_help, grep_configure_help): New
+       functions.
+       * tests/maintmode-configure-msg.test: Use them, reducing code
+       duplication and test brittleness.
+       * tests/help-depend.test: Likewise.
+       * tests/help-depend2.test: Likewise.
+       * tests/help-dmalloc.test: Likewise.
+       * tests/help-lispdir.test: Likewise.
+       * tests/help-multilib.test: Likewise.
+       * tests/help-python.test: Likewise.
+       * tests/help-regex.test: Likewise.
+       * tests/help-silent.test: Likewise.
+       * tests/help-upc.test: Likewise.
+       * tests/help-init.test: Make grepping of configure help screen
+       slightly stricter.
+       * tests/self-check-configure-help.test: New self test.
+       * tests/Makefile.am (TESTS): Add it.
+       From a report by Jim Meyering.
+
 2011-11-03  Stefano Lattarini  <address@hidden>
 
        Merge branch 'master' into testsuite-work
diff --git a/lib/Automake/ChannelDefs.pm b/lib/Automake/ChannelDefs.pm
index de3970c..3e9fd1b 100644
--- a/lib/Automake/ChannelDefs.pm
+++ b/lib/Automake/ChannelDefs.pm
@@ -292,12 +292,38 @@ sub switch_warning ($)
   elsif (channel_type ($cat) eq 'warning')
     {
       setup_channel $cat, silent => $has_no;
-      setup_channel 'portability-recursive', silent => $has_no
-        if $cat eq 'portability';
-      setup_channel 'extra-portability', silent => $has_no
-        if ($cat eq 'portability' && $has_no);
-      setup_channel 'portability', silent => $has_no
-        if ($cat eq 'extra-portability' && ! $has_no);
+      #
+      # Handling of portability warnings is trickier.  For relevant tests,
+      # see `dollarvar2', `extra-portability' and `extra-portability3'.
+      #
+      # -Wportability-recursive and -Wno-portability-recursive should not
+      # have any effect on other 'portability' or 'extra-portability'
+      # warnings, so there's no need to handle them separately or ad-hoc.
+      #
+      if ($cat eq 'extra-portability' && ! $has_no) # -Wextra-portability
+        {
+          # -Wextra-portability must enable 'portability' and
+          # 'portability-recursive' warnings.
+          setup_channel 'portability', silent => 0;
+          setup_channel 'portability-recursive', silent => 0;
+        }
+      if ($cat eq 'portability') # -Wportability or -Wno-portability
+        {
+          if ($has_no) # -Wno-portability
+            {
+              # -Wno-portability must disable 'extra-portability' and
+              # 'portability-recursive' warnings.
+              setup_channel 'portability-recursive', silent => 1;
+              setup_channel 'extra-portability', silent => 1;
+            }
+          else # -Wportability
+            {
+              # -Wportability must enable 'portability-recursive'
+              # warnings.  But it should have no influence over the
+              # 'extra-portability' warnings.
+              setup_channel 'portability-recursive', silent => 0;
+            }
+        }
     }
   else
     {
diff --git a/tests/Makefile.in b/tests/Makefile.in
index b260ad2..1933195 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -712,6 +712,7 @@ extra12.test \
 extra-programs-empty.test \
 extra-portability.test \
 extra-portability2.test \
+extra-portability3.test \
 extradep.test \
 extradep2.test \
 f90only.test \
@@ -1185,6 +1186,7 @@ reqd2.test \
 repeated-options.test \
 rulepat.test \
 self-check-cleanup.tap \
+self-check-configure-help.test \
 self-check-dir.tap \
 self-check-env-sanitize.tap \
 self-check-exit.tap \
diff --git a/tests/defs b/tests/defs
index 50b2381..28aadeb 100644
--- a/tests/defs
+++ b/tests/defs
@@ -327,6 +327,54 @@ AUTOMAKE_fails ()
   AUTOMAKE_run -e 1 ${1+"$@"}
 }
 
+# extract_configure_help { --OPTION | VARIABLE-NAME } [FILES]
+# -----------------------------------------------------------
+# Use this to extract from the output of `./configure --help' (or similar)
+# the description or help message associated to the given --OPTION or
+# VARIABLE-NAME.
+extract_configure_help ()
+{
+  am__opt_re='' am__var_re=''
+  case $1 in
+    --*'=')   am__opt_re="^  $1";;
+    --*'[=]') am__opt_re='^  '`printf '%s\n' "$1" | sed 's/...$//'`'\[=';;
+    --*)      am__opt_re="^  $1( .*|$)";;
+      *)      am__var_re="^  $1( .*|$)";;
+  esac
+  shift
+  if test x"$am__opt_re" != x; then
+    LC_ALL=C awk '
+      /'"$am__opt_re"'/        { print; do_print = 1; next; }
+      /^$/                     { do_print = 0; next }
+      /^  --/                  { do_print = 0; next }
+      (do_print == 1)          { print }
+    ' ${1+"$@"}
+  else
+    LC_ALL=C awk '
+      /'"$am__var_re"'/        { print; do_print = 1; next; }
+      /^$/                     { do_print = 0; next }
+      /^  [A-Z][A-Z0-9_]* /    { do_print = 0; next }
+      /^  [A-Z][A-Z0-9_]*$/    { do_print = 0; next }
+      (do_print == 1)          { print }
+    ' ${1+"$@"}
+  fi
+}
+
+# grep_configure_help { --OPTION | VARIABLE-NAME } REGEXP
+# -------------------------------------------------------
+# Grep the section of `./configure --help' output associated with either
+# --OPTION or VARIABLE-NAME for the given *extended* regular expression.
+grep_configure_help ()
+{
+  ./configure --help > am--all-help \
+    || { cat am--all-help; Exit 1; }
+  cat am--all-help
+  extract_configure_help "$1" am--all-help > am--our-help \
+    || { cat am--our-help; Exit 1; }
+  cat am--our-help
+  $EGREP "$2" am--our-help || Exit 1
+}
+
 # using_gmake
 # -----------
 # Return success if $MAKE is GNU make, return failure otherwise.
diff --git a/tests/dollarvar2.test b/tests/dollarvar2.test
index e1ac766..cda9605 100755
--- a/tests/dollarvar2.test
+++ b/tests/dollarvar2.test
@@ -19,6 +19,11 @@
 
 . ./defs || Exit 1
 
+#
+# 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))
@@ -26,11 +31,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 353141f..82f0654 100755
--- a/tests/extra-portability.test
+++ b/tests/extra-portability.test
@@ -18,52 +18,81 @@
 # warning categories:
 #   1. `-Wextra-portability' must imply `-Wportability'.
 #   2. `-Wno-portability' must imply `-Wno-extra-portability'.
+#   3. `-Wall' must imply `-Wextra-portability'.
 
 . ./defs || Exit 1
 
 set -e
 
+# We want (almost) complete control over automake options.
+AUTOMAKE="$am_original_AUTOMAKE --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
-libfoo_a_CPPFLAGS = -Dwhatever
 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 enables extra-portability.
+AUTOMAKE_fails -Wall
+grep 'requires.*AM_PROG_AR' stderr
 
-# Enabling extra-portability enables portability.
-AUTOMAKE_fails -Wnone -Wextra-portability
-# The expected diagnostic is
-#    Makefile.am:2: compiling `foo.c' with per-target flags requires 
`AM_PROG_CC_C_O' in `configure.in'
-#    .../lib/am/library.am: `libfoo.a': linking libraries using a non-POSIX
-#    .../lib/am/library.am: archiver requires `AM_PROG_AR' in `configure.in'
-#    Makefile.am:1:   while processing library `libfoo.a'
+# Disabling portability disables extra-portability as well.
+$AUTOMAKE -Wextra-portability -Wno-portability
+$AUTOMAKE -Wall -Wno-portability
+
+#
+# Now, a setup where also a "simple" portability warning is present.
+#
+
+# Per-target flags require the use of AM_PROG_CC_C_O in configure.ac.
+echo libfoo_a_CPPFLAGS = -Dwhatever >> Makefile.am
+
+# Enabling extra-portability enables portability as well ...
+AUTOMAKE_fails -Wextra-portability
+grep 'requires.*AM_PROG_CC_C_O' stderr
+grep 'requires.*AM_PROG_AR' stderr
+# ... even if it had been previously disabled.
+AUTOMAKE_fails -Wno-portability -Wextra-portability
 grep 'requires.*AM_PROG_CC_C_O' stderr
 grep 'requires.*AM_PROG_AR' stderr
 
-# Disabling extra-portability leaves portability intact.
+# Disabling extra-portability leaves portability intact (1).
+AUTOMAKE_fails -Wportability -Wno-extra-portability
+grep 'requires.*AM_PROG_CC_C_O' stderr
+grep 'requires.*AM_PROG_AR' stderr && Exit 1
+# Disabling extra-portability leaves portability intact (2).
 AUTOMAKE_fails -Wall -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'
 grep 'requires.*AM_PROG_CC_C_O' stderr
 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'
+AUTOMAKE_fails -Wportability
 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..9773b89
--- /dev/null
+++ b/tests/extra-portability3.test
@@ -0,0 +1,62 @@
+#! /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.
+AUTOMAKE="$am_original_AUTOMAKE --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/help-depend.test b/tests/help-depend.test
index e25f264..651e048 100755
--- a/tests/help-depend.test
+++ b/tests/help-depend.test
@@ -28,12 +28,10 @@ END
 $ACLOCAL
 $AUTOCONF
 
-./configure --help >stdout || { cat stdout; Exit 1; }
-cat stdout
+grep_configure_help --enable-dependency-tracking \
+                    ' not reject slow dependency extract'
 
-$EGREP '^  *--enable-dependency-tracking( |$)' stdout
-$EGREP '^  *--disable-dependency-tracking( |$)' stdout
-$FGREP ' speeds up one-time build' stdout
-$FGREP ' slow dependency extract' stdout
+grep_configure_help --disable-dependency-tracking \
+                    ' speeds up one-time build'
 
 :
diff --git a/tests/help-depend2.test b/tests/help-depend2.test
index 0eb5447..d44ff7a 100755
--- a/tests/help-depend2.test
+++ b/tests/help-depend2.test
@@ -29,12 +29,10 @@ END
 $ACLOCAL
 $AUTOCONF
 
-./configure --help >stdout || { cat stdout; Exit 1; }
-cat stdout
+grep_configure_help --enable-dependency-tracking \
+                    ' not reject slow dependency extract'
 
-$EGREP '^  *--enable-dependency-tracking( |$)' stdout
-$EGREP '^  *--disable-dependency-tracking( |$)' stdout
-$FGREP ' speeds up one-time build' stdout
-$FGREP ' slow dependency extract' stdout
+grep_configure_help --disable-dependency-tracking \
+                    ' speeds up one-time build'
 
 :
diff --git a/tests/help-dmalloc.test b/tests/help-dmalloc.test
index 708805b..dc8c4c1 100755
--- a/tests/help-dmalloc.test
+++ b/tests/help-dmalloc.test
@@ -27,11 +27,6 @@ END
 $ACLOCAL
 $AUTOCONF
 
-./configure --help >stdout || { cat stdout; Exit 1; }
-cat stdout
-
-$EGREP '^   *--with-dmalloc( |$) ' stdout
-$FGREP ' use dmalloc' stdout
-$FGREP 'www.dmalloc.com' stdout
+grep_configure_help --with-dmalloc ' use dmalloc.*http://www\.dmalloc\.com'
 
 :
diff --git a/tests/help-init.test b/tests/help-init.test
index 7698623..8b5ec71 100755
--- a/tests/help-init.test
+++ b/tests/help-init.test
@@ -30,8 +30,8 @@ $AUTOCONF
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
 
-grep '^  *--program-prefix[= ]' stdout
-grep '^  *--program-suffix[= ]' stdout
-grep '^  *--program-transform-name[= ]' 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
index a308021..9a72189 100755
--- a/tests/help-lispdir.test
+++ b/tests/help-lispdir.test
@@ -30,11 +30,8 @@ $AUTOCONF
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
 
-$EGREP '^  *--with-lispdir( |$)' stdout
-grep ' override.*lisp directory' stdout
-$EGREP '^  *EMACS( |$)' stdout
-grep ' .*[eE]macs editor' stdout
-$EGREP '^  *EMACSLOADPATH( |$)' stdout
-grep ' .*[eE]macs library search path' stdout
+grep_configure_help --with-lispdir ' override.*lisp directory'
+grep_configure_help EMACS          ' [eE]macs editor'
+grep_configure_help EMACSLOADPATH  ' [eE]macs library search path'
 
 :
diff --git a/tests/help-multilib.test b/tests/help-multilib.test
index e0bf6c7..d4df64d 100755
--- a/tests/help-multilib.test
+++ b/tests/help-multilib.test
@@ -27,10 +27,6 @@ END
 $ACLOCAL
 $AUTOCONF
 
-./configure --help >stdout || { cat stdout; Exit 1; }
-cat stdout
-
-$EGREP '^  *--enable-multilib( |$)' stdout
-$FGREP ' many library versions (default)' stdout
+grep_configure_help --enable-multilib ' many library versions \(default\)'
 
 :
diff --git a/tests/help-python.test b/tests/help-python.test
index e6a6fd3..9e4e48a 100755
--- a/tests/help-python.test
+++ b/tests/help-python.test
@@ -27,9 +27,6 @@ END
 $ACLOCAL
 $AUTOCONF
 
-./configure --help >stdout || { cat stdout; Exit 1; }
-cat stdout
-
-grep '^  *PYTHON  *the Python interpreter$' stdout
+grep_configure_help PYTHON 'the Python interpreter'
 
 :
diff --git a/tests/help-regex.test b/tests/help-regex.test
index aecfed9..2ae7704 100755
--- a/tests/help-regex.test
+++ b/tests/help-regex.test
@@ -26,11 +26,6 @@ END
 
 $ACLOCAL
 $AUTOCONF
-
-./configure --help >stdout || { cat stdout; Exit 1; }
-cat stdout
-
-$FGREP ' --without-regex ' stdout
-$FGREP ' use GNU rx ' stdout
+grep_configure_help --without-regex ' use GNU rx($| )'
 
 :
diff --git a/tests/help-silent.test b/tests/help-silent.test
index e41d166..855be52 100755
--- a/tests/help-silent.test
+++ b/tests/help-silent.test
@@ -28,16 +28,16 @@ $ACLOCAL
 
 mv -f configure.in configure.tmpl
 
+q="[\`'\"]"
+
 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
-  $EGREP '^  *--enable-silent-rules( |$)' stdout
-  grep ' less verbose build.*undo.*make V=1' stdout
-  $EGREP '^  *--disable-silent-rules ( |$)' stdout
-  grep ' verbose build.*undo.*make V=0' stdout
+  grep_configure_help --enable-silent-rules \
+                      " less verbose build.*\\(undo.*${q}make V=1${q}"
+  grep_configure_help --disable-silent-rules \
+                      " verbose build.*\\(undo.*${q}make V=0${q}"
 done
 
 :
diff --git a/tests/help-upc.test b/tests/help-upc.test
index a30c84c..0438b4d 100755
--- a/tests/help-upc.test
+++ b/tests/help-upc.test
@@ -27,10 +27,7 @@ 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
+grep_configure_help UPC      '[Uu]nified Parallel C compiler command'
+grep_configure_help UPCFLAGS '[Uu]nified Parallel C compiler flags'
 
 :
diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk
index e8d192e..6172d16 100644
--- a/tests/list-of-tests.mk
+++ b/tests/list-of-tests.mk
@@ -388,6 +388,7 @@ extra12.test \
 extra-programs-empty.test \
 extra-portability.test \
 extra-portability2.test \
+extra-portability3.test \
 extradep.test \
 extradep2.test \
 f90only.test \
@@ -861,6 +862,7 @@ reqd2.test \
 repeated-options.test \
 rulepat.test \
 self-check-cleanup.tap \
+self-check-configure-help.test \
 self-check-dir.tap \
 self-check-env-sanitize.tap \
 self-check-exit.tap \
diff --git a/tests/maintmode-configure-msg.test 
b/tests/maintmode-configure-msg.test
index 5771392..f32c4fa 100755
--- a/tests/maintmode-configure-msg.test
+++ b/tests/maintmode-configure-msg.test
@@ -49,9 +49,7 @@ $ACLOCAL
 
 $AUTOCONF --force
 
-./configure --help >stdout || { cat stdout; Exit 1; }
-cat stdout
-grep '^  *--enable-maintainer-mode.* enable make rules' stdout
+grep_configure_help --enable-maintainer-mode 'enable make rules'
 
 check_configure_message_with "no"
 check_configure_message_with "yes" --enable-maintainer-mode
@@ -59,9 +57,7 @@ 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
+grep_configure_help --enable-maintainer-mode 'enable make rules'
 
 check_configure_message_with "no"
 check_configure_message_with "yes" --enable-maintainer-mode
@@ -71,7 +67,7 @@ set_maintmode "enable"
 $AUTOCONF --force
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
-grep '^  *--disable-maintainer-mode.* disable make rules' stdout
+grep_configure_help --disable-maintainer-mode 'disable make rules'
 
 check_configure_message_with "yes"
 check_configure_message_with "no" --disable-maintainer-mode
diff --git a/tests/self-check-configure-help.test 
b/tests/self-check-configure-help.test
new file mode 100755
index 0000000..16f4b50
--- /dev/null
+++ b/tests/self-check-configure-help.test
@@ -0,0 +1,274 @@
+#! /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/>.
+
+# Sanity check on the function used by the automake testsuite to
+# analyze output of "configure --help".
+
+. ./defs || Exit 1
+
+# FIXME: this test is a good candidate for a conversion to TAP.
+
+# Prefer real-world data.  This is from the help screen of the
+# configure script from GNU coreutils, with small adaptations.
+cat > help <<'END'
+`configure' configures GNU coreutils 8.14a to adapt to many kinds of systems.
+
+Usage: ./configure [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print `checking ...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for `--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or `..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [/usr/local]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, `make install' will install all the files in
+`/usr/local/bin', `/usr/local/lib' etc.  You can specify
+an installation prefix other than `/usr/local' using `--prefix',
+for instance `--prefix=$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/coreutils]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --disable-largefile     omit support for large files
+  --enable-threads={posix|solaris|pth|win32}
+                          specify multithreading API
+  --disable-threads       build without multithread safety
+  --disable-acl           do not support ACLs
+  --disable-assert        turn off assertions
+  --disable-rpath         do not hardcode runtime library paths
+  --disable-xattr         do not support extended attributes
+  --disable-libcap        disable libcap support
+  --enable-gcc-warnings   turn on lots of GCC warnings (for developers)
+  --enable-install-program=PROG_LIST
+                          install the programs in PROG_LIST (comma-separated,
+                          default: none)
+  --enable-no-install-program=PROG_LIST
+                          do NOT install the programs in PROG_LIST
+                          (comma-separated, default: arch,hostname,su)
+  --disable-nls           do not use Native Language Support
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-gnu-ld           assume the C compiler uses GNU ld default=no
+  --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and DIR/lib
+  --without-libiconv-prefix     don't search for libiconv in includedir and 
libdir
+  --with-libpth-prefix[=DIR]  search for libpth in DIR/include and DIR/lib
+  --without-libpth-prefix     don't search for libpth in includedir and libdir
+  --without-included-regex
+                          don't compile regex; this is the default on systems
+                          with recent-enough versions of the GNU C Library
+                          (use with caution on other systems).
+  --without-selinux       do not use SELinux, even on systems with SELinux
+  --with-packager         String identifying the packager of this software
+  --with-packager-version Packager-specific version information
+  --with-packager-bug-reports
+                          Packager info for bug reports (URL/e-mail/...)
+  --with-tty-group[=NAME]
+                          group used by system for TTYs, "tty" when not
+                          specified (default: do not rely on any group used
+                          for TTYs)
+  --without-gmp           do not use the GNU MP library for arbitrary
+                          precision calculation (default: use it if available)
+  --with-libintl-prefix[=DIR]  search for libintl in DIR/include and DIR/lib
+  --without-libintl-prefix     don't search for libintl in includedir and 
libdir
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  YACC        The `Yet Another C Compiler' implementation to use. Defaults to
+              `bison -y'. Values other than `bison -y' will most likely break
+              on most systems.
+  YFLAGS      YFLAGS contains the list arguments that will be passed by
+              default to Bison. This script will default YFLAGS to the empty
+              string to avoid a default value of `-d' given by some make
+              applications.
+  DEFAULT_POSIX2_VERSION
+              POSIX version to default to; see 'config.hin'.
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <address@hidden>.
+General help using GNU software: <http://www.gnu.org/gethelp/>.
+END
+
+compare_extracted_help ()
+{
+  cat > exp || Exit 99
+  extract_configure_help "$1" help > got || Exit 1
+  cat exp
+  cat got
+  diff exp got || Exit 1
+}
+
+compare_extracted_help --disable-libcap <<'END'
+  --disable-libcap        disable libcap support
+END
+
+compare_extracted_help --disable-nls <<'END'
+  --disable-nls           do not use Native Language Support
+END
+
+compare_extracted_help --disable-option-checking <<'END'
+  --disable-option-checking  ignore unrecognized --enable/--with options
+END
+
+compare_extracted_help --build= <<'END'
+  --build=BUILD     configure for building on BUILD [guessed]
+END
+
+compare_extracted_help --host= <<'END'
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+END
+
+compare_extracted_help '--with-libintl-prefix[=]' <<'END'
+  --with-libintl-prefix[=DIR]  search for libintl in DIR/include and DIR/lib
+END
+
+compare_extracted_help --without-included-regex <<'END'
+  --without-included-regex
+                          don't compile regex; this is the default on systems
+                          with recent-enough versions of the GNU C Library
+                          (use with caution on other systems).
+END
+
+compare_extracted_help --enable-threads= <<'END'
+  --enable-threads={posix|solaris|pth|win32}
+                          specify multithreading API
+END
+
+compare_extracted_help '--with-tty-group[=]' <<'END'
+  --with-tty-group[=NAME]
+                          group used by system for TTYs, "tty" when not
+                          specified (default: do not rely on any group used
+                          for TTYs)
+END
+
+compare_extracted_help '--prefix=' <<'END'
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [/usr/local]
+END
+
+compare_extracted_help '--exec-prefix=' <<'END'
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+END
+
+compare_extracted_help CC <<'END'
+  CC          C compiler command
+END
+
+compare_extracted_help CPP <<'END'
+  CPP         C preprocessor
+END
+
+compare_extracted_help CPPFLAGS <<'END'
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+END
+
+compare_extracted_help YACC <<'END'
+  YACC        The `Yet Another C Compiler' implementation to use. Defaults to
+              `bison -y'. Values other than `bison -y' will most likely break
+              on most systems.
+END
+
+compare_extracted_help DEFAULT_POSIX2_VERSION <<'END'
+  DEFAULT_POSIX2_VERSION
+              POSIX version to default to; see 'config.hin'.
+END
+
+for o in \
+  '--nonesuch' \
+  '--nonesuch=' \
+  '--nonesuch[=]' \
+  '--disable-nls=' \
+  '--disable-nls[=]' \
+  '--without-included-regex=' \
+  '--without-included-regex[=]' \
+  '--prefix' \
+  '--prefix[=]' \
+  '--build' \
+  '--build[=]' \
+  '--with-tty-group' \
+  '--with-tty-group=' \
+  'NO_SUCH_VAR' \
+  'NOSUCHVAR' \
+; do
+  compare_extracted_help "$o" </dev/null
+done
+
+:


hooks/post-receive
-- 
GNU Automake



reply via email to

[Prev in Thread] Current Thread [Next in Thread]