2011-07-16 Stefano Lattarini <stefano.lattarini@gmail.com>
+ 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 <stefano.lattarini@gmail.com>
+
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.
help-silent.test \
help-upc.test \
hfs.test \
-hosts.test \
implicit.test \
info.test \
init.test \
help-silent.test \
help-upc.test \
hfs.test \
-hosts.test \
implicit.test \
info.test \
init.test \
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
+AC_CANONICAL_SYSTEM
AM_PATH_LISPDIR
AM_PATH_PYTHON
END
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
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=
'== 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"
: %%% 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
+++ /dev/null
-#! /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