summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Duret-Lutz <adl@gnu.org>2003-07-03 18:58:50 +0000
committerAlexandre Duret-Lutz <adl@gnu.org>2003-07-03 18:58:50 +0000
commit41649edb771b104c4cc7adbb38a7bccc3ddf3598 (patch)
tree220a1086f02ffd4e9a04527638783d78010418cd
parent88c387e73b858f83f204b26f71ae31b44fb2ec01 (diff)
downloadautomake-41649edb771b104c4cc7adbb38a7bccc3ddf3598.tar.gz
* Makefile.am (maintainer-clean): Disallow '$AUTOMAKE && exit 1'.
Ignore @...@ substitutions in comments. * tests/defs.in: Try to make the shell more POSIX compliant. (AUTOMAKE_run, AUTOMAKE_fails): New functions. * tests/README: Mention AUTOMAKE_fails. * tests/alloca.test, tests/alloca2.test, tests/ansi8.test, * tests/asm.test, tests/backsl3.test, tests/backsl4.test, * tests/badline.test, tests/badopt.test, tests/canon.test, * tests/canon5.test, tests/colneq.test, tests/comment3.test, * tests/comment5.test, tests/cond2.test, tests/cond20.test, * tests/cond23.test, tests/cond24.test, tests/cond27.test, * tests/condinc2.test, tests/conff2.test, tests/cxx2.test, * tests/dejagnu2.test, tests/dirforbid.test, * tests/distcom3.test, tests/else.test, tests/exdir2.test, * tests/exeext2.test, tests/gcj2.test, tests/gcj5.test, * tests/getopt.test, tests/gettext.test, tests/gettext2.test, * tests/gnits.test, tests/gnuwarn.test, tests/gnuwarn2.test, * tests/insh.test, tests/lex2.test, tests/libobj10.test, * tests/libobj12.test, tests/libobj13.test, * tests/libobj3.test, tests/library2.test, * tests/library3.test, tests/libtool4.test, * tests/libtool6.test, tests/lisp2.test, tests/location.test, * tests/nogzip2.test, tests/output5.test, tests/overrid.test, * tests/percent.test, tests/percent2.test, * tests/pluseq5.test, tests/pluseq7.test, tests/pluseq9.test, * tests/pr211.test, tests/primary.test, tests/primary2.test, * tests/python2.test, tests/recurs.test, tests/reqd2.test, * tests/seenc.test, tests/specflg.test, tests/specflg2.test, * tests/spell.test, tests/spell2.test, tests/srcsub.test, * tests/srcsub2.test, tests/stdlib.test, tests/subdir7.test, * tests/substtarg.test, tests/suffix11.test, * tests/symlink.test, tests/syntax.test, * tests/targetclash.test, tests/txinfo4.test, * tests/version3.test, tests/warnopts.test, * tests/xsource.test, tests/yacc2.test: Use set -e, AUTOMAKE_fails, and always grep error message.
-rw-r--r--ChangeLog37
-rw-r--r--Makefile.am10
-rw-r--r--Makefile.in12
-rw-r--r--tests/README3
-rwxr-xr-xtests/alloca.test3
-rwxr-xr-xtests/alloca2.test3
-rwxr-xr-xtests/ansi8.test7
-rwxr-xr-xtests/asm.test11
-rwxr-xr-xtests/backsl3.test2
-rwxr-xr-xtests/backsl4.test3
-rwxr-xr-xtests/badline.test16
-rwxr-xr-xtests/badopt.test9
-rwxr-xr-xtests/canon.test12
-rwxr-xr-xtests/canon5.test17
-rwxr-xr-xtests/colneq.test7
-rwxr-xr-xtests/comment3.test12
-rwxr-xr-xtests/comment5.test13
-rwxr-xr-xtests/cond2.test12
-rwxr-xr-xtests/cond20.test8
-rwxr-xr-xtests/cond23.test6
-rwxr-xr-xtests/cond24.test6
-rwxr-xr-xtests/cond27.test7
-rwxr-xr-xtests/condinc2.test12
-rwxr-xr-xtests/conff2.test3
-rwxr-xr-xtests/cxx2.test7
-rw-r--r--tests/defs.in36
-rwxr-xr-xtests/dejagnu2.test5
-rwxr-xr-xtests/dirforbid.test8
-rwxr-xr-xtests/distcom3.test7
-rwxr-xr-xtests/else.test14
-rwxr-xr-xtests/exdir2.test13
-rwxr-xr-xtests/exeext2.test8
-rwxr-xr-xtests/gcj2.test12
-rwxr-xr-xtests/gcj5.test7
-rwxr-xr-xtests/getopt.test16
-rwxr-xr-xtests/gettext.test14
-rwxr-xr-xtests/gettext2.test11
-rwxr-xr-xtests/gnits.test20
-rwxr-xr-xtests/gnuwarn.test7
-rwxr-xr-xtests/gnuwarn2.test3
-rwxr-xr-xtests/insh.test11
-rwxr-xr-xtests/lex2.test7
-rwxr-xr-xtests/libobj10.test13
-rwxr-xr-xtests/libobj12.test8
-rwxr-xr-xtests/libobj13.test7
-rwxr-xr-xtests/libobj3.test5
-rwxr-xr-xtests/library2.test7
-rwxr-xr-xtests/library3.test7
-rwxr-xr-xtests/libtool4.test7
-rwxr-xr-xtests/libtool6.test7
-rwxr-xr-xtests/lisp2.test13
-rwxr-xr-xtests/location.test5
-rwxr-xr-xtests/nogzip2.test3
-rwxr-xr-xtests/output5.test9
-rwxr-xr-xtests/overrid.test3
-rwxr-xr-xtests/percent.test8
-rwxr-xr-xtests/percent2.test7
-rwxr-xr-xtests/pluseq5.test23
-rwxr-xr-xtests/pluseq7.test12
-rwxr-xr-xtests/pluseq9.test18
-rwxr-xr-xtests/pr211.test14
-rwxr-xr-xtests/primary.test12
-rwxr-xr-xtests/primary2.test12
-rwxr-xr-xtests/python2.test19
-rwxr-xr-xtests/recurs.test12
-rwxr-xr-xtests/reqd2.test7
-rwxr-xr-xtests/seenc.test11
-rwxr-xr-xtests/specflg.test13
-rwxr-xr-xtests/specflg2.test17
-rwxr-xr-xtests/spell.test12
-rwxr-xr-xtests/spell2.test12
-rwxr-xr-xtests/srcsub.test12
-rwxr-xr-xtests/srcsub2.test13
-rwxr-xr-xtests/stdlib.test9
-rwxr-xr-xtests/subdir7.test10
-rwxr-xr-xtests/substtarg.test9
-rwxr-xr-xtests/suffix11.test5
-rwxr-xr-xtests/symlink.test12
-rwxr-xr-xtests/syntax.test12
-rwxr-xr-xtests/targetclash.test7
-rwxr-xr-xtests/txinfo4.test12
-rwxr-xr-xtests/version3.test12
-rwxr-xr-xtests/warnopts.test6
-rwxr-xr-xtests/xsource.test11
-rwxr-xr-xtests/yacc2.test29
85 files changed, 489 insertions, 410 deletions
diff --git a/ChangeLog b/ChangeLog
index ee33b2aa7..f7f9ee54d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,42 @@
2003-07-03 Alexandre Duret-Lutz <adl@gnu.org>
+ * Makefile.am (maintainer-clean): Disallow '$AUTOMAKE && exit 1'.
+ Ignore @...@ substitutions in comments.
+ * tests/defs.in: Try to make the shell more POSIX compliant.
+ (AUTOMAKE_run, AUTOMAKE_fails): New functions.
+ * tests/README: Mention AUTOMAKE_fails.
+ * tests/alloca.test, tests/alloca2.test, tests/ansi8.test,
+ * tests/asm.test, tests/backsl3.test, tests/backsl4.test,
+ * tests/badline.test, tests/badopt.test, tests/canon.test,
+ * tests/canon5.test, tests/colneq.test, tests/comment3.test,
+ * tests/comment5.test, tests/cond2.test, tests/cond20.test,
+ * tests/cond23.test, tests/cond24.test, tests/cond27.test,
+ * tests/condinc2.test, tests/conff2.test, tests/cxx2.test,
+ * tests/dejagnu2.test, tests/dirforbid.test,
+ * tests/distcom3.test, tests/else.test, tests/exdir2.test,
+ * tests/exeext2.test, tests/gcj2.test, tests/gcj5.test,
+ * tests/getopt.test, tests/gettext.test, tests/gettext2.test,
+ * tests/gnits.test, tests/gnuwarn.test, tests/gnuwarn2.test,
+ * tests/insh.test, tests/lex2.test, tests/libobj10.test,
+ * tests/libobj12.test, tests/libobj13.test,
+ * tests/libobj3.test, tests/library2.test,
+ * tests/library3.test, tests/libtool4.test,
+ * tests/libtool6.test, tests/lisp2.test, tests/location.test,
+ * tests/nogzip2.test, tests/output5.test, tests/overrid.test,
+ * tests/percent.test, tests/percent2.test,
+ * tests/pluseq5.test, tests/pluseq7.test, tests/pluseq9.test,
+ * tests/pr211.test, tests/primary.test, tests/primary2.test,
+ * tests/python2.test, tests/recurs.test, tests/reqd2.test,
+ * tests/seenc.test, tests/specflg.test, tests/specflg2.test,
+ * tests/spell.test, tests/spell2.test, tests/srcsub.test,
+ * tests/srcsub2.test, tests/stdlib.test, tests/subdir7.test,
+ * tests/substtarg.test, tests/suffix11.test,
+ * tests/symlink.test, tests/syntax.test,
+ * tests/targetclash.test, tests/txinfo4.test,
+ * tests/version3.test, tests/warnopts.test,
+ * tests/xsource.test, tests/yacc2.test: Use set -e,
+ AUTOMAKE_fails, and always grep error message.
+
* automake.in (handle_ltlibraries): Fix call to msg.
* tests/stamph.test: Delete.
diff --git a/Makefile.am b/Makefile.am
index cfad0e491..aad258fff 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -190,6 +190,11 @@ maintainer-check: automake aclocal
echo 'Do not run "automake" in the above tests. Use "$$AUTOMAKE" instead.' 1>&2; \
exit 1; \
fi
+## Use AUTOMAKE_fails when appropriate
+ @if grep -v '^#' $(srcdir)/tests/*.test | grep '\$$AUTOMAKE.*&&.*exit'; then \
+ echo 'Use AUTOMAKE_fails + grep to catch automake failures in the above tests.' 1>&2; \
+ exit 1; \
+ fi
## Tests should never call aclocal directly.
@if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*aclocal'; then \
echo 'Do not run "aclocal" in the above tests. Use "$$ACLOCAL" instead.' 1>&2; \
@@ -236,12 +241,11 @@ maintainer-check: automake aclocal
fi
## Try to make sure all @...@ substitutions are covered by our
## substitution rule.
- @if test `grep -E '@[A-Za-z_0-9]+@' aclocal | wc -l` -ne 0; then \
+ @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' aclocal | wc -l` -ne 0; then \
echo "Unresolved @...@ substitution in aclocal" 1>&2; \
exit 1; \
fi
-## In automake there are a few valid ones.
- @if test `grep -E '@[A-Za-z_0-9]+@' automake | wc -l` -ne 5; then \
+ @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' automake | wc -l` -ne 0; then \
echo "Unresolved @...@ substitution in automake" 1>&2; \
exit 1; \
fi
diff --git a/Makefile.in b/Makefile.in
index 957bcb9ea..2a0f75700 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -584,7 +584,7 @@ distcheck: dist
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
- for i in $(DIST_ARCHIVES); do echo $$i; done) | \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e '1{h;s/./=/g;p;x}' -e '$${p;x}'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
@@ -696,7 +696,7 @@ installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf autom4te.cache
+ -rm -rf $(top_srcdir)/autom4te.cache
maintainer-clean-am: distclean-am maintainer-clean-aminfo \
maintainer-clean-generic maintainer-clean-vti
@@ -847,6 +847,10 @@ maintainer-check: automake aclocal
echo 'Do not run "automake" in the above tests. Use "$$AUTOMAKE" instead.' 1>&2; \
exit 1; \
fi
+ @if grep -v '^#' $(srcdir)/tests/*.test | grep '\$$AUTOMAKE.*&&.*exit'; then \
+ echo 'Use AUTOMAKE_fails + grep to catch automake failures in the above tests.' 1>&2; \
+ exit 1; \
+ fi
@if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*aclocal'; then \
echo 'Do not run "aclocal" in the above tests. Use "$$ACLOCAL" instead.' 1>&2; \
exit 1; \
@@ -882,11 +886,11 @@ maintainer-check: automake aclocal
echo 'Do not use egrep or fgrep in the above files, they are not portable.' 1>&2; \
exit 1; \
fi
- @if test `grep -E '@[A-Za-z_0-9]+@' aclocal | wc -l` -ne 0; then \
+ @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' aclocal | wc -l` -ne 0; then \
echo "Unresolved @...@ substitution in aclocal" 1>&2; \
exit 1; \
fi
- @if test `grep -E '@[A-Za-z_0-9]+@' automake | wc -l` -ne 5; then \
+ @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' automake | wc -l` -ne 0; then \
echo "Unresolved @...@ substitution in automake" 1>&2; \
exit 1; \
fi
diff --git a/tests/README b/tests/README
index 1f06b29bf..5aa328bc3 100644
--- a/tests/README
+++ b/tests/README
@@ -111,8 +111,7 @@ Do not
Do not test an Automake error with `$AUTOMAKE && exit 1', or in three
years we'll discover that this test failed for some other bogus reason.
This happened many times. Better use something like
- $AUTOMAKE 2>stderr && exit 1
- cat stderr
+ AUTOMAKE_fails
grep 'expected diagnostic' stderr
(Note this doesn't prevent the test from failing for another
reason, but at least it makes sure the original error is still
diff --git a/tests/alloca.test b/tests/alloca.test
index 15811f395..d2a10d816 100755
--- a/tests/alloca.test
+++ b/tests/alloca.test
@@ -31,7 +31,6 @@ libtu_a_LIBADD = @ALLOCA@
END
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep 'Makefile.am:1:.*AC_PROG_RANLIB' stderr
grep 'Makefile.am:3:.*AC_FUNC_ALLOCA' stderr
diff --git a/tests/alloca2.test b/tests/alloca2.test
index 36db4af04..d91fed969 100755
--- a/tests/alloca2.test
+++ b/tests/alloca2.test
@@ -31,7 +31,6 @@ libtu_la_LIBADD = @LTALLOCA@
END
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep 'Makefile.am:1:.*AC_PROG_LIBTOOL' stderr
grep 'Makefile.am:3:.*ALLOCA' stderr
diff --git a/tests/ansi8.test b/tests/ansi8.test
index c4ce8e273..d05119dff 100755
--- a/tests/ansi8.test
+++ b/tests/ansi8.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -30,6 +30,5 @@ bin_PROGRAMS = hello
END
$ACLOCAL
-$AUTOMAKE -a 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails -a
grep AM_C_PROTOTYPES stderr
diff --git a/tests/asm.test b/tests/asm.test
index 6802fc28b..e4a7f8af0 100755
--- a/tests/asm.test
+++ b/tests/asm.test
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -41,8 +41,7 @@ AC_OUTPUT(Makefile)
END
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep AM_PROG_AS stderr
# On fast machines the autom4te.cache created during the above run of
@@ -64,8 +63,7 @@ AC_OUTPUT(Makefile)
END
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep CCAS stderr
grep AM_PROG_AS stderr
@@ -83,8 +81,7 @@ AC_OUTPUT(Makefile)
END
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep CCASFLAGS stderr
grep AM_PROG_AS stderr
diff --git a/tests/backsl3.test b/tests/backsl3.test
index bb465e49e..1448d2e68 100755
--- a/tests/backsl3.test
+++ b/tests/backsl3.test
@@ -30,6 +30,6 @@ foo = \
END
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
+AUTOMAKE_fails
cat stderr
grep 'trailing backslash' stderr
diff --git a/tests/backsl4.test b/tests/backsl4.test
index a59324952..bb20b4e35 100755
--- a/tests/backsl4.test
+++ b/tests/backsl4.test
@@ -42,8 +42,7 @@ echo ' fum' >>Makefile.am
$ACLOCAL
$AUTOCONF
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep ':1:.*whitespace' stderr
grep ':5:.*whitespace' stderr
./configure
diff --git a/tests/badline.test b/tests/badline.test
index 5fb113ede..2325f3e59 100755
--- a/tests/badline.test
+++ b/tests/badline.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -23,13 +23,17 @@
. ./defs || exit 1
-cat >> configure.in << 'END'
+set -e
+
+cat > configure.in << END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
AC_SUBST(TEXINFOS)
+AC_CONFIG_FILES([Makefile])
END
: > Makefile.am
$ACLOCAL || exit 1
-$AUTOMAKE > out 2>&1 && exit 1
-grep Makefile out && exit 1
-exit 0
+AUTOMAKE_fails
+grep 'configure.in:3:.*info_TEXINFOS' stderr
diff --git a/tests/badopt.test b/tests/badopt.test
index 748d3d6f8..9837b3ffa 100755
--- a/tests/badopt.test
+++ b/tests/badopt.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -26,5 +26,6 @@ cat > Makefile.am << 'END'
AUTOMAKE_OPTIONS = zardoz
END
-$AUTOMAKE && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails
+grep zardoz stderr
diff --git a/tests/canon.test b/tests/canon.test
index 79971446f..42fc107a5 100755
--- a/tests/canon.test
+++ b/tests/canon.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,6 +22,8 @@
. ./defs || exit 1
+set -e
+
echo AC_PROG_CC >> configure.in
cat > Makefile.am << 'END'
@@ -29,6 +31,6 @@ bin_PROGRAMS = sniff-glue
sniff-glue_SOURCES = sg.c
END
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails
+grep 'Makefile.am:2:.*sniff_glue_SOURCES' stderr
diff --git a/tests/canon5.test b/tests/canon5.test
index 66e6519f3..6db9f360f 100755
--- a/tests/canon5.test
+++ b/tests/canon5.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -19,10 +19,12 @@
# Boston, MA 02111-1307, USA.
# Test to make sure that we allow variable names starting in
-# non-letters.
+# non-letters. Whatever that might mean.
. ./defs || exit 1
+set -e
+
echo AC_PROG_CC >> configure.in
cat > Makefile.am << 'END'
@@ -30,7 +32,7 @@ bin_PROGRAMS = 123test
123test_SOURCES = 123.c
END
-$ACLOCAL || exit 1
+$ACLOCAL
$AUTOMAKE || exit 1
cat > Makefile.am << 'END'
@@ -39,20 +41,21 @@ _foo_SOURCES = foo.c
END
# Variables starting with `_' are not portable.
-$AUTOMAKE -Wno-portability || exit 1
+$AUTOMAKE -Wno-portability
cat > Makefile.am << 'END'
bin_PROGRAMS = ,foo
,foo_SOURCES = foo.c
END
-# Variables starting with `_' are not portable.
-$AUTOMAKE -Wno-portability && exit 1
+# Variables starting with `,' are not portable.
+AUTOMAKE_fails -Wno-portability
+grep 'Makefile.am:2:.*_foo_SOURCES' stderr
cat > Makefile.am << 'END'
bin_PROGRAMS = ,foo
_foo_SOURCES = foo.c
END
-# Variables starting with `_' are not portable.
+# Variables starting with `_' or `,' are not portable.
$AUTOMAKE -Wno-portability
diff --git a/tests/colneq.test b/tests/colneq.test
index cf4aea9c0..908fba25c 100755
--- a/tests/colneq.test
+++ b/tests/colneq.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -30,8 +30,7 @@ data_DATA = $(ICONS)
END
$ACLOCAL
-$AUTOMAKE 2> stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep ':=.*not portable' stderr
echo 'AUTOMAKE_OPTIONS = -Wno-portability' >> Makefile.am
diff --git a/tests/comment3.test b/tests/comment3.test
index 541697f6b..fd36e1636 100755
--- a/tests/comment3.test
+++ b/tests/comment3.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -25,11 +25,13 @@
. ./defs || exit 1
+set -e
+
cat > Makefile.am << 'END'
install-data-local:
# Tru64 Unix must die
END
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails
+grep 'Makefile.am:2:.*#' stderr
diff --git a/tests/comment5.test b/tests/comment5.test
index a81559dfe..f4d523e8e 100755
--- a/tests/comment5.test
+++ b/tests/comment5.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -40,8 +40,7 @@ var = foo
EOF
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep '^Makefile.am:5: blank line following trailing backslash' stderr
@@ -58,8 +57,7 @@ all-local:
var = foo
EOF
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep '^Makefile.am:2: blank line following trailing backslash' stderr
@@ -71,8 +69,7 @@ cat > Makefile.inc << 'EOF'
EOF
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep '^Makefile.inc:2: blank line following trailing backslash' stderr
grep '^Makefile.am:1: .*included from here' stderr
diff --git a/tests/cond2.test b/tests/cond2.test
index bbc672f79..68d5ca1d2 100755
--- a/tests/cond2.test
+++ b/tests/cond2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1997, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1997, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,6 +22,8 @@
. ./defs || exit 1
+set -e
+
cat > configure.in << 'END'
AC_INIT
AM_INIT_AUTOMAKE(nonesuch, nonesuch)
@@ -40,6 +42,6 @@ END
mkdir dir1
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails
+grep 'dir2.*does not exist' stderr
diff --git a/tests/cond20.test b/tests/cond20.test
index c550c48d9..e56fbea05 100755
--- a/tests/cond20.test
+++ b/tests/cond20.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -50,5 +50,5 @@ set -e
$ACLOCAL
$AUTOCONF
-$AUTOMAKE -a && exit 1
-$AUTOMAKE -a 2>&1| grep "recursively defined"
+AUTOMAKE_fails -a
+grep "recursively defined" stderr
diff --git a/tests/cond23.test b/tests/cond23.test
index 0442a8e45..c6fe42dce 100755
--- a/tests/cond23.test
+++ b/tests/cond23.test
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -37,5 +37,5 @@ endif
EOF
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
+AUTOMAKE_fails
grep 'libdir was already defined' stderr
diff --git a/tests/cond24.test b/tests/cond24.test
index 4260340e6..11b6eb542 100755
--- a/tests/cond24.test
+++ b/tests/cond24.test
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -38,5 +38,5 @@ endif
EOF
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
+AUTOMAKE_fails
grep 'foo was already defined' stderr
diff --git a/tests/cond27.test b/tests/cond27.test
index 9b7410639..aa6741e99 100755
--- a/tests/cond27.test
+++ b/tests/cond27.test
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -37,7 +37,6 @@ my_DATA = foo
EOF
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep ' USE_FOO' stderr && exit 1
grep '!USE_FOO' stderr
diff --git a/tests/condinc2.test b/tests/condinc2.test
index 0f8fbe748..ae808efd8 100755
--- a/tests/condinc2.test
+++ b/tests/condinc2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,6 +22,8 @@
. ./defs || exit 1
+set -e
+
cat >> configure.in << 'END'
AM_CONDITIONAL(TOBE, false)
END
@@ -38,6 +40,6 @@ target: dependency
endif
END
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails
+grep 'adjunct:3: too many conditionals closed' stderr
diff --git a/tests/conff2.test b/tests/conff2.test
index 3808da715..8e3e01c2e 100755
--- a/tests/conff2.test
+++ b/tests/conff2.test
@@ -33,7 +33,6 @@ AC_OUTPUT
END
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep 'configure.in:3:.*AC_CONFIG_FILES' stderr
grep 'configure.in:4:.*AC_CONFIG_HEADERS' stderr
diff --git a/tests/cxx2.test b/tests/cxx2.test
index 5afaa0c2a..3b020c5cf 100755
--- a/tests/cxx2.test
+++ b/tests/cxx2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -32,6 +32,5 @@ hello_SOURCES = hello.cpp
END
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep AC_PROG_CXX stderr
diff --git a/tests/defs.in b/tests/defs.in
index 1d0735a10..ca310420c 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -22,6 +22,18 @@
# Defines for Automake testing environment.
# Tom Tromey <tromey@cygnus.com>
+# Be Bourne compatible.
+# (Snippet copied from configure's initialization in Autoconf 2.57.)
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+
# Ensure we are running from the right directory.
test -f ./defs || {
echo "defs: not found in current directory" 1>&2
@@ -297,6 +309,30 @@ sleep='sleep @MODIFICATION_DELAY@'
testsrcdir=$srcdir
unset srcdir
+# AUTOMAKE_run status [options...]
+# --------------------------------
+# Run Automake with OPTIONS, and fail if automake
+# does not exit with STATUS.
+AUTOMAKE_run ()
+{
+ expected_exitcode=$1
+ shift
+ exitcode=0
+ $AUTOMAKE ${1+"$@"} 2>stderr >stdout || exitcode=$?
+ cat stderr
+ cat stdout
+ test $exitcode = $expected_exitcode || exit 1
+}
+
+# AUTOMAKE_fails [options...]
+# ---------------------------
+# Run Automake with OPTIONS, and fail if automake
+# does not exit with STATUS.
+AUTOMAKE_fails ()
+{
+ AUTOMAKE_run 1 ${1+"$@"}
+}
+
# Turn on shell traces when VERBOSE=x.
if test "x$VERBOSE" = xx; then
set -x
diff --git a/tests/dejagnu2.test b/tests/dejagnu2.test
index c6142b653..7cca82ce4 100755
--- a/tests/dejagnu2.test
+++ b/tests/dejagnu2.test
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -45,6 +45,5 @@ $MAKE site.exp >stdout
cat stdout
grep foo stdout
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep 'Makefile.am:3:.*site.exp' stderr
diff --git a/tests/dirforbid.test b/tests/dirforbid.test
index f112a1c77..9cc404917 100755
--- a/tests/dirforbid.test
+++ b/tests/dirforbid.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -36,7 +36,7 @@ for i in data_PROGRAMS lib_HEADERS ; do
$i = foo
END
$ACLOCAL
- # This strange syntax works around NetBSD Problem Report #11542.
- $AUTOMAKE -a && exit 1 || :
+ AUTOMAKE_fails -a
+ grep 'Makefile.am:1:.*directory' stderr
done
:
diff --git a/tests/distcom3.test b/tests/distcom3.test
index e92ccfa36..40880fc38 100755
--- a/tests/distcom3.test
+++ b/tests/distcom3.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -54,6 +54,5 @@ sed -n -e '/^DIST_COMMON =.*\\$/ {
# Should warn about missing README.
: > Makefile.am
-$AUTOMAKE --add-missing --gnu 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails --add-missing --gnu
grep README stderr
diff --git a/tests/else.test b/tests/else.test
index 04bbdd531..7510eb031 100755
--- a/tests/else.test
+++ b/tests/else.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,6 +22,8 @@
. ./defs || exit 1
+set -e
+
echo 'AM_CONDITIONAL(FOO, true)' >> configure.in
cat > Makefile.am << 'END'
@@ -30,12 +32,12 @@ APACHE_DIR_IS_SRC = @APACHE_DIR_IS_SRC@
# we only need to descend into the c dir if we're doing a 1.3 DSO configuration
ifeq ("${APACHE_DIR_IS_SRC}","yes")
-SUBDIRS = java
+SUBDIRS = java
else
SUBDIRS = c java
endif
END
-$ACLOCAL || exit 1
-$AUTOMAKE > out 2>&1 && exit 1
-grep :7: out
+$ACLOCAL
+AUTOMAKE_fails
+grep 'Makefile.am:7:.*else without if' stderr
diff --git a/tests/exdir2.test b/tests/exdir2.test
index d5d0c7e4b..1f21ef2fc 100755
--- a/tests/exdir2.test
+++ b/tests/exdir2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,11 +22,14 @@
. ./defs || exit 1
+set -e
+
cat > Makefile.am << 'EOF'
html_DATA = zot.html
pkgdata_DATA = qbert
EOF
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails
+grep 'pkgdatadir' stderr && exit 1
+grep 'Makefile.am:1:.*htmldir.*undefined' stderr
diff --git a/tests/exeext2.test b/tests/exeext2.test
index 6402a5774..f216351e1 100755
--- a/tests/exeext2.test
+++ b/tests/exeext2.test
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -39,11 +39,9 @@ END
$ACLOCAL
$AUTOMAKE -Wnone
-$AUTOMAKE -Wnone -Wobsolete 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails -Wnone -Wobsolete
grep 'deprecated.*maude' stderr
-$AUTOMAKE -Wall 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails -Wall
grep 'deprecated.*maude' stderr
grep 'overrid.*maude' stderr
diff --git a/tests/gcj2.test b/tests/gcj2.test
index 1a8eb1a16..33b43c4f0 100755
--- a/tests/gcj2.test
+++ b/tests/gcj2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,6 +22,8 @@
. ./defs || exit 1
+set -e
+
cat >> configure.in << 'END'
_AM_DEPENDENCIES(GCJ)
AC_SUBST(GCJ)
@@ -32,6 +34,6 @@ bin_PROGRAMS = convert
convert_SOURCES = x/../convert.java
END
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails
+grep 'Makefile.am:.*\.\.' stderr
diff --git a/tests/gcj5.test b/tests/gcj5.test
index a84db785b..87d465b83 100755
--- a/tests/gcj5.test
+++ b/tests/gcj5.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -34,6 +34,5 @@ convert_SOURCES = convert.java
END
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep AM_PROG_GCJ stderr
diff --git a/tests/getopt.test b/tests/getopt.test
index 2e96d9389..cceb43ee4 100755
--- a/tests/getopt.test
+++ b/tests/getopt.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -26,24 +26,20 @@
set -e
# This is expected to fail ...
-$AUTOMAKE -Wnonexistant 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails -Wnonexistant
grep ':.*nonexistant' stderr
# ... but this should not.
-$AUTOMAKE -Wnonexistant --help 2>stderr
-cat stderr
+AUTOMAKE_run 0 -Wnonexistant --help
grep ':.*nonexistant' stderr && exit 1
# Similarly, this should fail ...
-$AUTOMAKE --nonexistant 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails --nonexistant 2>stderr
grep ':.*nonexistant' stderr
# ... but this should not.
-$AUTOMAKE --nonexistant --help 2>stderr
-cat stderr
+AUTOMAKE_run 0 --nonexistant --help
grep ':.*nonexistant' stderr && exit 1
:
diff --git a/tests/gettext.test b/tests/gettext.test
index a4d2e6860..ef9d37f8c 100755
--- a/tests/gettext.test
+++ b/tests/gettext.test
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -37,18 +37,15 @@ $ACLOCAL
# po/ and intl/ are required
-$AUTOMAKE --add-missing 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails --add-missing
grep 'AM_GNU_GETTEXT.*SUBDIRS' stderr
echo 'SUBDIRS = po' >Makefile.am
-$AUTOMAKE --add-missing 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails --add-missing
grep 'AM_GNU_GETTEXT.*intl' stderr
echo 'SUBDIRS = intl' >Makefile.am
-$AUTOMAKE --add-missing 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails --add-missing
grep 'AM_GNU_GETTEXT.*po' stderr
# Ok.
@@ -70,6 +67,5 @@ $AUTOMAKE
# Still, SUBDIRS must be defined.
: >Makefile.am
-$AUTOMAKE --add-missing 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails --add-missing
grep 'AM_GNU_GETTEXT.*SUBDIRS' stderr
diff --git a/tests/gettext2.test b/tests/gettext2.test
index f72da9e21..b572f768c 100755
--- a/tests/gettext2.test
+++ b/tests/gettext2.test
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -38,13 +38,11 @@ $ACLOCAL
# po/ is required, but intl/ isn't.
-$AUTOMAKE --add-missing 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails --add-missing
grep 'AM_GNU_GETTEXT.*SUBDIRS' stderr
echo 'SUBDIRS = foo' >Makefile.am
-$AUTOMAKE --add-missing 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails --add-missing
grep 'AM_GNU_GETTEXT.*po' stderr
# Ok.
@@ -61,6 +59,5 @@ grep 'with-included-gettext' Makefile.in && exit 1
mkdir intl
echo 'SUBDIRS = po intl' >Makefile.am
-$AUTOMAKE --add-missing 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails --add-missing
grep 'intl.*AM_GNU_GETTEXT' stderr
diff --git a/tests/gnits.test b/tests/gnits.test
index c48f4e1b4..f5567610c 100755
--- a/tests/gnits.test
+++ b/tests/gnits.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1996, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,10 +22,12 @@
. ./defs || exit 1
-cat > configure.in << 'END'
-PACKAGE=nonesuch
-VERSION=3.5.3.2
-AC_OUTPUT(Makefile)
+set -e
+
+cat > configure.in << END
+AC_INIT([$me], [3.5.3.2])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES(Makefile)
END
cat > Makefile.am << 'END'
@@ -41,6 +43,6 @@ END
: > ChangeLog
: > THANKS
-$ACLOCAL || exit 1
-$AUTOMAKE --gnits && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails --gnits
+grep 'configure.in:.*3\.5\.3\.2' stderr
diff --git a/tests/gnuwarn.test b/tests/gnuwarn.test
index 9dca3b177..4c7bfdf8a 100755
--- a/tests/gnuwarn.test
+++ b/tests/gnuwarn.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -46,8 +46,7 @@ $ACLOCAL
# Don't warn in foreign mode
$AUTOMAKE -Wnone --add-missing --foreign
# Warn in gnu mode
-$AUTOMAKE -Wnone --add-missing --gnu 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails -Wnone --add-missing --gnu
grep 'Makefile.am:1:.*CFLAGS' stderr
grep 'Makefile.am:2:.*LDFLAGS' stderr
# No reason to warn about CXXFLAGS since it's not used.
diff --git a/tests/gnuwarn2.test b/tests/gnuwarn2.test
index bf3753b8e..cf352d635 100755
--- a/tests/gnuwarn2.test
+++ b/tests/gnuwarn2.test
@@ -44,6 +44,5 @@ AUTOMAKE_OPTIONS = gnu
END
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep 'configure.in:2:.*no-installman' stderr
diff --git a/tests/insh.test b/tests/insh.test
index b4c0e7f00..a8e82ef89 100755
--- a/tests/insh.test
+++ b/tests/insh.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -23,11 +23,12 @@
. ./defs || exit 1
+set -e
+
rm -f mkinstalldirs
: > Makefile.am
-$ACLOCAL || exit 1
-$AUTOMAKE > out 2>&1 && exit 1
-
-grep mkinstalldirs out
+$ACLOCAL
+AUTOMAKE_fails
+grep 'required.*mkinstalldirs' stderr
diff --git a/tests/lex2.test b/tests/lex2.test
index 01e9c061b..d715b3387 100755
--- a/tests/lex2.test
+++ b/tests/lex2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1996, 1997, 1998, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -36,6 +36,5 @@ END
: > joe.l
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep AM_PROG_LEX stderr
diff --git a/tests/libobj10.test b/tests/libobj10.test
index 8dd3ca7b4..034351433 100755
--- a/tests/libobj10.test
+++ b/tests/libobj10.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -23,6 +23,8 @@
. ./defs || exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_RANLIB
@@ -35,9 +37,10 @@ noinst_LIBRARIES = libfoo.a
libfoo_a_LIBADD = @LIBOBJS@
END
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
+$ACLOCAL
+AUTOMAKE_fails
+grep 'Makefile.am:2:.*foo\.c' stderr
echo 'BUILT_SOURCES = foo.c' >> Makefile.am
-$AUTOMAKE || exit 1
+$AUTOMAKE
diff --git a/tests/libobj12.test b/tests/libobj12.test
index e8237e482..c3de96dd9 100755
--- a/tests/libobj12.test
+++ b/tests/libobj12.test
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -57,8 +57,7 @@ $AUTOMAKE
# This however should be diagnosed, since foo.c and bar.c are in @LIBOBJS@.
echo 'libfoo_a_SOURCES += foo.c' >> Makefile.am
echo 'p1_SOURCES += bar.c' >> Makefile.am
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
$FGREP foo.c stderr
$FGREP bar.c stderr
@@ -70,6 +69,5 @@ END
$AUTOMAKE
grep 'a_DEPENDENCIES.*LIBOBJS' Makefile.in
echo 'a_SOURCES = foo.c' >> Makefile.am
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
$FGREP foo.c stderr
diff --git a/tests/libobj13.test b/tests/libobj13.test
index 528fec9f1..70b9c845a 100755
--- a/tests/libobj13.test
+++ b/tests/libobj13.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -50,6 +50,5 @@ $AUTOMAKE --add-missing
# This however should be diagnosed, since foo.c is in @LIBOBJS@.
echo 'libfoo_la_SOURCES += foo.c' >> Makefile.am
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
$FGREP foo.c stderr
diff --git a/tests/libobj3.test b/tests/libobj3.test
index 8e1331c50..58c24af8f 100755
--- a/tests/libobj3.test
+++ b/tests/libobj3.test
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -35,6 +35,5 @@ libtu_a_LIBADD = @LIBOBJS@
END
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep 'Makefile.am:3:.*LIBOBJS' stderr
diff --git a/tests/library2.test b/tests/library2.test
index 03fb0171d..316d17463 100755
--- a/tests/library2.test
+++ b/tests/library2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -29,6 +29,5 @@ EXTRA_LIBRARIES = libfoo.a
END
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep AC_PROG_RANLIB stderr
diff --git a/tests/library3.test b/tests/library3.test
index d07df886e..bbfb7e7b9 100755
--- a/tests/library3.test
+++ b/tests/library3.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -52,8 +52,7 @@ EXTRA_LIBRARIES = libfoo.a
END
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep '^Makefile.am:.*: !A and !C and !D$' stderr
# Is there only one missing condition?
test `grep ': ' stderr | wc -l` = 1 || exit 1
diff --git a/tests/libtool4.test b/tests/libtool4.test
index 37354b316..ed3c430f3 100755
--- a/tests/libtool4.test
+++ b/tests/libtool4.test
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -29,6 +29,5 @@ EXTRA_LTLIBRARIES = liblib.la
END
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep AC_PROG_LIBTOOL stderr
diff --git a/tests/libtool6.test b/tests/libtool6.test
index f88ac8d4b..b7412ae62 100755
--- a/tests/libtool6.test
+++ b/tests/libtool6.test
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -45,8 +45,7 @@ END
libtoolize
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep 'liba\.la.* installed .*lib' stderr
grep 'Makefile.am:5:' stderr
grep 'Makefile.am:2:' stderr
diff --git a/tests/lisp2.test b/tests/lisp2.test
index 2bcf9aa6f..b733cad53 100755
--- a/tests/lisp2.test
+++ b/tests/lisp2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -31,8 +31,7 @@ lisp_LISP = foo.el
END
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep AM_PATH_LISPDIR stderr
@@ -45,8 +44,7 @@ lisp_LISP = foo.el
END
$ACLOCAL
-$AUTOMAKE -a 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep AM_PATH_LISPDIR stderr
echo 3
@@ -58,8 +56,7 @@ lisp_LISP = foo.el
END
$ACLOCAL
-$AUTOMAKE -a 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep AM_PATH_LISPDIR stderr
diff --git a/tests/location.test b/tests/location.test
index 8ee95c996..dc5f948f9 100755
--- a/tests/location.test
+++ b/tests/location.test
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -49,8 +49,7 @@ VAR = 1 \
END
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
# Smash the useless difference of lib file locations.
sed 's,^.*lib/am/\([a-z]*\.am\),\1,' stderr >observed
diff --git a/tests/nogzip2.test b/tests/nogzip2.test
index a86b84f32..d2b1d42fd 100755
--- a/tests/nogzip2.test
+++ b/tests/nogzip2.test
@@ -34,8 +34,7 @@ END
: > Makefile.am
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep 'configure.in:2:.*no-dist-gzip' stderr
echo 'AUTOMAKE_OPTIONS = dist-bzip2' > Makefile.am
diff --git a/tests/output5.test b/tests/output5.test
index 5e11f0c4a..aa6d349c4 100755
--- a/tests/output5.test
+++ b/tests/output5.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1997, 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1997, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -33,6 +33,5 @@ END
: > Makefile.am
$ACLOCAL
-$AUTOMAKE > output 2>&1 && exit 1
-cat output
-grep 'found or specified' output
+AUTOMAKE_fails
+grep 'found or specified' stderr
diff --git a/tests/overrid.test b/tests/overrid.test
index c8398e128..bed724a46 100755
--- a/tests/overrid.test
+++ b/tests/overrid.test
@@ -45,8 +45,7 @@ END
$ACLOCAL
$AUTOMAKE -Wno-override
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep install-local stderr && exit 1 # There is no such thing as install-local
grep installcheck-local stderr
grep html-local stderr
diff --git a/tests/percent.test b/tests/percent.test
index e476ccbd1..960e9dac4 100755
--- a/tests/percent.test
+++ b/tests/percent.test
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -38,5 +38,5 @@ liver_SOURCES = foo.c
EOF
$ACLOCAL
-$AUTOMAKE -Wportability && exit 1
-exit 0
+AUTOMAKE_fails -Wportability
+grep 'Makefile.am:4:.*%' stderr
diff --git a/tests/percent2.test b/tests/percent2.test
index c8b627363..2fafb8ad8 100755
--- a/tests/percent2.test
+++ b/tests/percent2.test
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -38,8 +38,7 @@ ${ARCH}/%.$(OBJEXT): %.c
EOF
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep '%.*pattern.*rules' stderr
# No error otherwise.
diff --git a/tests/pluseq5.test b/tests/pluseq5.test
index 90ff195fe..2736c4b48 100755
--- a/tests/pluseq5.test
+++ b/tests/pluseq5.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,6 +22,8 @@
. ./defs || exit 1
+set -e
+
echo 'AM_CONDITIONAL(CHECK, true)' >> configure.in
cat > Makefile.am << 'END'
@@ -31,10 +33,8 @@ endif
INCLUDES += def
END
-$ACLOCAL || exit 1
-$AUTOMAKE 2>stderr && exit 1
-
-cat stderr # for debugging
+$ACLOCAL
+AUTOMAKE_fails
# We expect the following diagnostic:
#
@@ -45,19 +45,18 @@ cat stderr # for debugging
# Makefile.am:4: `+=' in the same conditions as the definitions.
# Is !CHECK mentioned?
-grep ':.*!CHECK$' stderr || exit 1
+grep ':.*!CHECK$' stderr
# Is there only one missing condition?
-test `grep ': ' stderr | wc -l` = 1 || exit 1
+test `grep ': ' stderr | wc -l` = 1
# By the way, Automake should suggest using AM_CPPFLAGS,
# because INCLUDES is an obsolete name.
-grep AM_CPPFLAGS stderr || exit 1
+grep AM_CPPFLAGS stderr
# A way to suppress the obsolete warning is to use
# -Wno-obsolete:
echo 'AUTOMAKE_OPTIONS = -Wno-obsolete' >> Makefile.am
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep AM_CPPFLAGS stderr && exit 1
# !CHECK should still be mentioned.
-grep ':.*!CHECK$' stderr || exit 1
+grep ':.*!CHECK$' stderr
diff --git a/tests/pluseq7.test b/tests/pluseq7.test
index 3b426a472..e2cc6dcdc 100755
--- a/tests/pluseq7.test
+++ b/tests/pluseq7.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,6 +22,8 @@
. ./defs || exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_RANLIB
@@ -36,6 +38,6 @@ END
: > q.c
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails
+grep 'Makefile.am:3:.*AR' stderr
diff --git a/tests/pluseq9.test b/tests/pluseq9.test
index 527215a4c..828485a57 100755
--- a/tests/pluseq9.test
+++ b/tests/pluseq9.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,6 +22,8 @@
. ./defs || exit 1
+set -e
+
cat >>configure.in <<EOF
AM_CONDITIONAL(COND1, true)
AM_CONDITIONAL(COND2, true)
@@ -52,10 +54,8 @@ endif
B += dd
END
-$ACLOCAL || exit 1
-$AUTOMAKE 2>stderr && exit 1
-
-cat stderr # for debugging
+$ACLOCAL
+AUTOMAKE_fails
# We expect the following diagnostic:
#
@@ -69,8 +69,6 @@ cat stderr # for debugging
# COND1_FALSE (merging the last two conditions), so we'll support
# this case in the check too.
-grep ': !COND1 and !COND3$' stderr || exit 1
+grep ': !COND1 and !COND3$' stderr
# Make sure there is exactly one missing condition.
-test `grep ': ' stderr | wc -l` = 1 || exit 1
-
-:
+test `grep ': ' stderr | wc -l` = 1
diff --git a/tests/pr211.test b/tests/pr211.test
index ba79ae38c..d2acb0a62 100755
--- a/tests/pr211.test
+++ b/tests/pr211.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -23,6 +23,8 @@
required=libtoolize
. ./defs || exit 1
+set -e
+
cat > configure.in << 'END'
AC_INIT(Makefile.am)
AM_INIT_AUTOMAKE(hello,0.23)
@@ -38,7 +40,7 @@ helldl_SOURCES = foo.c
libfoo_la_SOURCES = foo.c
END
-libtoolize || exit 1
-$ACLOCAL || exit 1
-$AUTOMAKE -a && exit 1
-exit 0
+libtoolize
+$ACLOCAL
+AUTOMAKE_fails -a
+$FGREP 'foo.$(OBJEXT)' stderr
diff --git a/tests/primary.test b/tests/primary.test
index fce700cf2..3b9915971 100755
--- a/tests/primary.test
+++ b/tests/primary.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,10 +22,12 @@
. ./defs || exit 1
+set -e
+
cat > Makefile.am << 'END'
bin_PROGRAMS = @programs@
END
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails
+grep 'EXTRA_PROGRAMS' stderr
diff --git a/tests/primary2.test b/tests/primary2.test
index 0a036bf99..fccbf4f4b 100755
--- a/tests/primary2.test
+++ b/tests/primary2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,6 +22,8 @@
. ./defs || exit 1
+set -e
+
echo AC_PROG_CC >> configure.in
cat > Makefile.am << 'END'
@@ -29,6 +31,6 @@ bin_PROGRAMS = @programs@
EXTRA_PROGRAMS = joe @more@
END
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails
+grep EXTRA_PROGRAMS stderr
diff --git a/tests/python2.test b/tests/python2.test
index fb74145ee..b17e26f76 100755
--- a/tests/python2.test
+++ b/tests/python2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -33,8 +33,7 @@ python_PYTHON = foo.py
END
$ACLOCAL
-$AUTOMAKE -a 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails -a
grep AM_PATH_PYTHON stderr
echo 2
@@ -46,8 +45,7 @@ pkgpython_PYTHON = foo.py
END
$ACLOCAL
-$AUTOMAKE -a 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails -a
grep AM_PATH_PYTHON stderr
@@ -60,8 +58,7 @@ pyexec_PYTHON = foo.py
END
$ACLOCAL
-$AUTOMAKE -a 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails -a
grep AM_PATH_PYTHON stderr
@@ -74,8 +71,7 @@ pkgpyexec_PYTHON = foo.py
END
$ACLOCAL
-$AUTOMAKE -a 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails -a
grep AM_PATH_PYTHON stderr
@@ -88,8 +84,7 @@ pkgpyexec_PYTHON = foo.py
END
$ACLOCAL
-$AUTOMAKE -a 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails -a
grep AM_PATH_PYTHON stderr
diff --git a/tests/recurs.test b/tests/recurs.test
index bea8f3576..d4db672e1 100755
--- a/tests/recurs.test
+++ b/tests/recurs.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,6 +22,8 @@
. ./defs || exit 1
+set -e
+
cat > configure.in << 'END'
AC_INIT
AM_INIT_AUTOMAKE(nonesuch, nonesuch)
@@ -36,6 +38,6 @@ bin_PROGRAMS = $(foo)
foo = $(bin_PROGRAMS)
END
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails
+grep 'Makefile.am:.*bin_PROGRAMS.*recursively defined' stderr
diff --git a/tests/reqd2.test b/tests/reqd2.test
index ab17a168e..428575bfa 100755
--- a/tests/reqd2.test
+++ b/tests/reqd2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -52,8 +52,7 @@ $AUTOCONF
test -f autoconf/ltmain.sh # Sanity check.
rm -f autoconf/ltmain.sh
-$AUTOMAKE --add-missing --copy 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails --add-missing --copy
grep 'autoconf/ltmain.sh' stderr
grep 'running more than two' stderr && exit 1
diff --git a/tests/seenc.test b/tests/seenc.test
index 3b2ecdbc6..17aa17e08 100755
--- a/tests/seenc.test
+++ b/tests/seenc.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1997, 1998, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -40,7 +40,6 @@ END
: > mountlist.c
$ACLOCAL
-$AUTOMAKE 2>err && exit 1
-cat err
-$FGREP CC err
-$FGREP CXX err
+AUTOMAKE_fails
+$FGREP CC stderr
+$FGREP CXX stderr
diff --git a/tests/specflg.test b/tests/specflg.test
index 7670cdd31..069d67ee6 100755
--- a/tests/specflg.test
+++ b/tests/specflg.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,6 +22,8 @@
. ./defs || exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
END
@@ -34,12 +36,13 @@ foo_CFLAGS = -DBAR
END
# Make sure `compile' is required.
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
+$ACLOCAL
+AUTOMAKE_fails
+grep 'required.*compile' stderr
: > compile
-$AUTOMAKE || exit 1
+$AUTOMAKE
# Look for $(COMPILE) -c in .c.o rule.
grep 'COMPILE. [^-]' Makefile.in && exit 1
diff --git a/tests/specflg2.test b/tests/specflg2.test
index 514b95236..d1c2000c8 100755
--- a/tests/specflg2.test
+++ b/tests/specflg2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,6 +22,8 @@
. ./defs || exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_CXX
@@ -37,22 +39,23 @@ libfoo_a_CXXFLAGS = -DZOT
END
# Make sure `compile' is required.
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
+$ACLOCAL
+AUTOMAKE_fails
+grep 'required.*compile' stderr
: > compile
-$AUTOMAKE || exit 1
+$AUTOMAKE
# Look for $(COMPILE) -c in .c.o rule.
grep 'COMPILE. [^-]' Makefile.in && exit 1
# Look for libfoo_a-foo.o.
-grep foo Makefile.in || exit 1
+grep foo Makefile.in
grep '[^-]foo\.o' Makefile.in && exit 1
# Look for libfoo_a-bar.o.
-grep bar Makefile.in || exit 1
+grep bar Makefile.in
grep '[^-]bar\.o' Makefile.in && exit 1
exit 0
diff --git a/tests/spell.test b/tests/spell.test
index dbcde0b36..ee0e82f8b 100755
--- a/tests/spell.test
+++ b/tests/spell.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,12 +22,14 @@
. ./defs || exit 1
+set -e
+
cat > Makefile.am << 'END'
bin_PROGRAMS = zardoz foo
zardoz_SOURCES = x.c
boo_SOURCES = y.c
END
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails
+grep 'Makefile.am:3:.*boo' stderr
diff --git a/tests/spell2.test b/tests/spell2.test
index 2180f160f..bac6699b9 100755
--- a/tests/spell2.test
+++ b/tests/spell2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,6 +22,8 @@
. ./defs || exit 1
+set -e
+
echo AC_PROG_CC >> configure.in
cat > Makefile.am << 'END'
@@ -30,6 +32,6 @@ zardoz_SOURCES = x.c
qardoz_LDADD = -ljoe
END
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails
+grep 'Makefile.am:3:.*qardoz' stderr
diff --git a/tests/srcsub.test b/tests/srcsub.test
index 8cd226bf2..aeb2cff75 100755
--- a/tests/srcsub.test
+++ b/tests/srcsub.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,6 +22,8 @@
. ./defs || exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
END
@@ -32,6 +34,6 @@ x_SOURCES = x.c @FOO@
EXTRA_x_SOURCES = y.c
END
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails
+grep 'Makefile.am:2:.*x_SOURCES.*substitution' stderr
diff --git a/tests/srcsub2.test b/tests/srcsub2.test
index 797dfb61a..254f5d0e6 100755
--- a/tests/srcsub2.test
+++ b/tests/srcsub2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,6 +22,8 @@
. ./defs || exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
END
@@ -34,6 +36,7 @@ x_SOURCES = x.c $(foo)
EXTRA_x_SOURCES = y.c
END
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails
+grep 'Makefile.am:2:.*bar.*substitution' stderr
+grep 'Makefile.am:2:.*x_SOURCES' stderr
diff --git a/tests/stdlib.test b/tests/stdlib.test
index bad86ada4..1f4bdad4f 100755
--- a/tests/stdlib.test
+++ b/tests/stdlib.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -34,7 +34,6 @@ noinst_LIBRARIES = foo
END
$ACLOCAL
-$AUTOMAKE 2> output.log && exit 1
-cat output.log
+AUTOMAKE_fails
# We're specifically testing for line-number information.
-grep 'Makefile.am:1:.*foo.*standard library name' output.log
+grep 'Makefile.am:1:.*foo.*standard library name' stderr
diff --git a/tests/subdir7.test b/tests/subdir7.test
index f76b1606f..283f5b458 100755
--- a/tests/subdir7.test
+++ b/tests/subdir7.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -36,8 +36,7 @@ echo 'SUBDIRS = obj' >Makefile.am
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep 'obj.*BSD' stderr
cat >Makefile.am <<EOF
@@ -45,6 +44,5 @@ SUBDIRS = @STH@
DIST_SUBDIRS = obj
EOF
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep 'obj.*BSD' stderr
diff --git a/tests/substtarg.test b/tests/substtarg.test
index 9bc721468..077cc156b 100755
--- a/tests/substtarg.test
+++ b/tests/substtarg.test
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -23,6 +23,8 @@
. ./defs || exit 1
+set -e
+
cat > configure.in << 'END'
AC_INIT(fakelib.c)
AM_INIT_AUTOMAKE(fakelib,0.0)
@@ -44,11 +46,8 @@ libfake@SUBST@.a: Makefile $(libfake@SUBST@_a_OBJECTS) $(libfake@SUBST@_a_DEPEND
@echo here we do some custom stuff, instead of invoking the linker
END
-set -e
-
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
grep 'overrid.*libfake@SUBST@.a' stderr
num=`grep '^libfake@SUBST@.a:' Makefile.in | wc -l`
test $num -eq 1
diff --git a/tests/suffix11.test b/tests/suffix11.test
index 1ba71ba52..03cb3934a 100755
--- a/tests/suffix11.test
+++ b/tests/suffix11.test
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -50,8 +50,7 @@ END
$ACLOCAL
$AUTOCONF
# What we do is not portable. Automake should warn.
-$AUTOMAKE -a 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails -a
grep 'Inference rules can have only one target before the colon' stderr
# But this should work anyway.
$AUTOMAKE -a -Wno-portability
diff --git a/tests/symlink.test b/tests/symlink.test
index 6b505de28..597336d9e 100755
--- a/tests/symlink.test
+++ b/tests/symlink.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1996, 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -23,6 +23,8 @@
. ./defs || exit 1
+set -e
+
rm -f install-sh
rm -f mkinstalldirs
@@ -32,6 +34,6 @@ cat >> configure.in << 'END'
AC_CONFIG_AUX_DIR(sub)
END
-$ACLOCAL || exit 1
-$AUTOMAKE --add-missing && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails --add-missing
+grep 'error while making link' stderr
diff --git a/tests/syntax.test b/tests/syntax.test
index c04639d9d..733112e24 100755
--- a/tests/syntax.test
+++ b/tests/syntax.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,12 +22,14 @@
. ./defs || exit 1
+set -e
+
cat > Makefile.am << 'END'
foo = q \
lib_LTLIBRARIES = foo.la
END
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails
+grep 'Makefile.am:2:.*blank line' stderr
diff --git a/tests/targetclash.test b/tests/targetclash.test
index 91ca5ef98..987645285 100755
--- a/tests/targetclash.test
+++ b/tests/targetclash.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -35,6 +35,5 @@ END
$ACLOCAL
$AUTOCONF
-$AUTOMAKE -a 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails -a
grep 'redefinition.*ctags' stderr
diff --git a/tests/txinfo4.test b/tests/txinfo4.test
index 31af8b8bf..faeecdc8c 100755
--- a/tests/txinfo4.test
+++ b/tests/txinfo4.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1997, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1997, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,6 +22,8 @@
. ./defs || exit 1
+set -e
+
cat > Makefile.am << 'END'
info_TEXINFOS = textutils.texi
END
@@ -29,6 +31,6 @@ END
echo '@setfilename textutils.frob' > textutils.texi
: > texinfo.tex
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails
+grep 'textutils.texi:1:.*textutils.frob.*extension' stderr
diff --git a/tests/version3.test b/tests/version3.test
index eca3ad938..082bce331 100755
--- a/tests/version3.test
+++ b/tests/version3.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -22,10 +22,12 @@
. ./defs || exit 1
+set -e
+
cat > Makefile.am << 'END'
AUTOMAKE_OPTIONS = 9.9x
END
-$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
-exit 0
+$ACLOCAL
+AUTOMAKE_fails
+grep 'Makefile.am:1:.*Automake 9.9x' stderr
diff --git a/tests/warnopts.test b/tests/warnopts.test
index d33b801ef..2ee439186 100755
--- a/tests/warnopts.test
+++ b/tests/warnopts.test
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -24,7 +24,6 @@
set -e
-
cat >>configure.in <<END
AC_CONFIG_FILES([sub/Makefile])
AC_OUTPUT
@@ -49,8 +48,7 @@ foo_SOURCES = unused
END
$ACLOCAL
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
+AUTOMAKE_fails
# The expected diagnostic is
# Makefile.am:3: unused variable: `foo_SOURCES'
# sub/Makefile.am:2: `INCLUDES' is the old name for `AM_CPPFLAGS'
diff --git a/tests/xsource.test b/tests/xsource.test
index 2c923e483..5ba93d96c 100755
--- a/tests/xsource.test
+++ b/tests/xsource.test
@@ -1,5 +1,6 @@
#! /bin/sh
-# Copyright (C) 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003
+# Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +15,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -23,6 +24,8 @@
. ./defs || exit 1
+set -e
+
cat > Makefile.am << 'END'
bin_PROGRAMS = zardoz
zardoz_SOURCES = z.c x/z.c
@@ -38,5 +41,5 @@ mkdir x
: > x/z.c
$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
-exit 0
+AUTOMAKE_fails
+$FGREP 'z.$(OBJEXT)' stderr
diff --git a/tests/yacc2.test b/tests/yacc2.test
index 9bb304432..e39cb7ac8 100755
--- a/tests/yacc2.test
+++ b/tests/yacc2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with autoconf; see the file COPYING. If not, write to
+# along with Automake; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
@@ -23,6 +23,8 @@
. ./defs || exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_YACC
@@ -39,8 +41,8 @@ cp Makefile.am Makefile.src
-$ACLOCAL || exit 1
-$AUTOMAKE || exit 1
+$ACLOCAL
+$AUTOMAKE
# If zardoz.h IS mentioned, fail
grep 'zardoz.h' Makefile.in > /dev/null && exit 1
@@ -50,17 +52,17 @@ grep 'zardoz.h' Makefile.in > /dev/null && exit 1
cp Makefile.src Makefile.am
echo 'AM_YFLAGS = -d' >> Makefile.am
-$AUTOMAKE || exit 1
+$AUTOMAKE
# If zardoz.h is NOT mentioned, fail
-grep 'zardoz.h' Makefile.in > /dev/null || exit 1
+grep 'zardoz.h' Makefile.in > /dev/null
cp Makefile.src Makefile.am
echo 'AM_YFLAGS = ' >> Makefile.am
-$AUTOMAKE || exit 1
+$AUTOMAKE
# If zardoz.h IS mentioned, fail
grep 'zardoz.h' Makefile.in > /dev/null && exit 1
@@ -71,22 +73,21 @@ cp Makefile.src Makefile.am
echo 'YFLAGS = -d' >> Makefile.am
# YFLAGS is a use variable.
-$AUTOMAKE 2>stderr && exit 1
-cat stderr
-grep 'YFLAGS' stderr || exit 1
-$AUTOMAKE -Wno-gnu || exit 1
+AUTOMAKE_fails
+grep 'YFLAGS' stderr
+$AUTOMAKE -Wno-gnu
# If zardoz.h is NOT mentioned, fail
-grep 'zardoz.h' Makefile.in > /dev/null || exit 1
+grep 'zardoz.h' Makefile.in > /dev/null
cp Makefile.src Makefile.am
echo 'YFLAGS = ' >> Makefile.am
-$AUTOMAKE -Wno-gnu || exit 1
+$AUTOMAKE -Wno-gnu
# If zardoz.h IS mentioned, fail
grep 'zardoz.h' Makefile.in > /dev/null && exit 1
-exit 0
+: