automake-patches
[Top][All Lists]
Advanced

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

[FYI] {testsuite-work} tests: remove duplication about testing of config


From: Stefano Lattarini
Subject: [FYI] {testsuite-work} tests: remove duplication about testing of config.* aux files
Date: Sat, 16 Jul 2011 14:00:23 +0200

* tests/add-missing.test: Also check that the `AC_CANONICAL_SYSTEM'
autoconf macro causes the `config.sub' and `config.guess' scripts
to be installed by `automake --add-missing'.  Since we are at it,
fix minor buglets and cosmetic issues in the `check_' function.
* tests/hosts.test: Removed, completely subsumed by the previous
test now.
* tests/Makefile.am (TESTS): Update.
---
 ChangeLog              |   11 ++++++++++
 tests/Makefile.am      |    1 -
 tests/Makefile.in      |    1 -
 tests/add-missing.test |   21 +++++++-----------
 tests/hosts.test       |   53 ------------------------------------------------
 5 files changed, 19 insertions(+), 68 deletions(-)
 delete mode 100755 tests/hosts.test

diff --git a/ChangeLog b/ChangeLog
index 41acf61..88611c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2011-07-16  Stefano Lattarini  <address@hidden>
 
+       tests: remove duplication about testing of config.* aux files
+       * tests/add-missing.test: Also check that the `AC_CANONICAL_SYSTEM'
+       autoconf macro causes the `config.sub' and `config.guess' scripts
+       to be installed by `automake --add-missing'.  Since we are at it,
+       fix minor buglets and cosmetic issues in the `check_' function.
+       * tests/hosts.test: Removed, completely subsumed by the previous
+       test now.
+       * tests/Makefile.am (TESTS): Update.
+
+2011-07-16  Stefano Lattarini  <address@hidden>
+
        tests: more uses of the 'unindent' subroutine
        * tests/backcompat.test: Prefer `unindent' over plain `cat' for
        here documents created from within a loop of if/else body.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 155d628..bfede0d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -541,7 +541,6 @@ help-regex.test \
 help-silent.test \
 help-upc.test \
 hfs.test \
-hosts.test \
 implicit.test \
 info.test \
 init.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 003d07f..235f2ef 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -829,7 +829,6 @@ help-regex.test \
 help-silent.test \
 help-upc.test \
 hfs.test \
-hosts.test \
 implicit.test \
 info.test \
 init.test \
diff --git a/tests/add-missing.test b/tests/add-missing.test
index 7e3d08c..9fd858d 100755
--- a/tests/add-missing.test
+++ b/tests/add-missing.test
@@ -45,6 +45,7 @@ AC_PROG_CC
 AC_CANONICAL_BUILD
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
+AC_CANONICAL_SYSTEM
 AM_PATH_LISPDIR
 AM_PATH_PYTHON
 END
@@ -63,12 +64,12 @@ check_ ()
   set +x # Temporary disable shell traces to remove noise from log files.
   override=no
   run_aclocal=no
-  extra_files=
+  extra_file=
   while test $# -gt 0; do
     case $1 in
       --override) override=yes;;
       --run-aclocal) run_aclocal=yes;;
-      --extra-file*) extra_files="$with_files $2"; shift;;
+      --extra-file) extra_file=$2; shift;;
       *) framework_failure_ "check_: invalid argument '$1'";;
     esac
     shift
@@ -81,13 +82,7 @@ check_ ()
   else
     cp ../configure.stub configure.in
   fi
-  for f in $extra_files; do
-    if test -f ../$f; then
-      cp ../$f .
-    else
-      : > $f
-    fi
-  done
+  test -z "$extra_file" || cp ../"$extra_file" .
   # Read description of "test scenario" from standard input.
   what=
   line=
@@ -97,9 +92,8 @@ check_ ()
       '== Makefile.am ==') what=Makefile.am;;
       '== configure.in ==') what=configure.in;;
       '== Files ==') what=LIST;;
-      '==.*') framework_failure_ "invalid input line: $line";;
-      ''|'#%'*)
-        : empty line or ad-hoc comment, ignore;;
+      '==*') framework_failure_ "invalid input line: $line";;
+      ''|'#%'*) : Empty line or ad-hoc comment, ignore. ;;
       *)
         if test $what = LIST; then
           files="$files $line"
@@ -219,7 +213,8 @@ END
 
 : %%% config.guess and config.sub %%%
 
-for macro in AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_CANONICAL_TARGET; do
+for macro in AC_CANONICAL_BUILD AC_CANONICAL_HOST \
+             AC_CANONICAL_TARGET AC_CANONICAL_SYSTEM; do
   check_ <<END
 == Files ==
 config.sub
diff --git a/tests/hosts.test b/tests/hosts.test
deleted file mode 100755
index ec5f12e..0000000
--- a/tests/hosts.test
+++ /dev/null
@@ -1,53 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2004, 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/>.
-
-# Test to make sure automake correctly recognizes presence of
-# AC_CANONICAL_(BUILD|HOST|SYSTEM|TARGET), and creates config.* in all
-# those cases.
-# From Norman Gray.
-
-. ./defs || Exit 1
-
-: >Makefile.am
-
-$ACLOCAL
-$AUTOMAKE --add-missing
-test ! -f config.guess
-test ! -f config.sub
-
-# Test all four of the AC_CANONICAL_* targets, including _SYSTEM, which is
-# supported but deprecated by autoconf.
-for macro in AC_CANONICAL_BUILD AC_CANONICAL_HOST \
-             AC_CANONICAL_SYSTEM AC_CANONICAL_TARGET
-do
-  rm -rf autom4te.cache config.sub config.guess
-
-  cat >configure.in<<EOF
-AC_INIT([hosts], [1.0])
-$macro
-AM_INIT_AUTOMAKE
-AC_CONFIG_FILES([Makefile])
-EOF
-
-  $ACLOCAL
-  $AUTOMAKE --add-missing
-
-  # Show the files which were installed
-  ls
-
-  test -f config.guess
-  test -f config.sub
-done
-- 
1.7.2.3




reply via email to

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