And another patch enabling a more widespread use of the `errexit' shell flag in test scripts. This one does most of the tests from `m' to `z' (but not the `texinfo*.test' tests; I think it's better to keep those for a separate patch).
This patch shouldn't cause problems, as the modified tests do not use shell functions nor complex shell constructs, loops or conditionals. OK for maint? Regards, Stefano
From 6029db4727931d0d49122b89c932ee0c24dc6542 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Fri, 20 Aug 2010 22:33:44 +0200 Subject: [PATCH] Enable `set -e' in more tests (plus some tweakings). * tests/mkinstall.test: Enable `errexit' shell flag, and related changes. Add a trailing `:' command, if needed. * tests/mdate2.test: Likewise. * tests/objc.test: Likewise. * tests/noinst.test: Likewise. * tests/outdir.test: Likewise. * tests/number.test: Likewise. * tests/pluseq.test: Likewise. * tests/req.test: Likewise. * tests/rulepat.test: Likewise. * tests/specflg6.test: Likewise. * tests/spell3.test: Likewise. * tests/parse.test: Likewise, and ... (configure.in): Use the stub created by ./defs, rather than writing it from scratch. * tests/mdate4.test: Likewise. * tests/mkinstall.test: Likewise, and ... (configure.in): ... drop useless call to `AC_OUTPUT'. * tests/output.test: Enable `errexit' shell flag, and related changes. Add a trailing `:' command. (configure.in): Modernize. * tests/output2.test: Likewise. * tests/output3.test: Likewise. * tests/output4.test: Likewise. * tests/mdate3.test: Enable `errexit' shell flag, and related changes. Prefer `$me' over hard-coded test name. * tests/nodistdir.test: Enable `errexit' shell flag, and related changes. Prefer trailing `:' over trailing `Exit 0'. * tests/nodist.test: Likewise. Also, prefer cat + here-doc over echo to create input test files, and do not create useless dummy C source files. * tests/nodist2.test: Likewise. * tests/ppf77.test: Enable `errexit' shell flag, with related changes. Add a trailing `:' command. Do not create useless dummy source files. * tests/spelling.test: Enable `errexit' shell flag, with related changes. Add a trailing `:' command. Also, grep Automake error message. * tests/specflg3.test: Enable `errexit' shell flag, with related changes. Avoid unportable use of `-e' option of fgrep. Prefer trailing `:' over trailing `Exit 0'. Remove extra empty lines, and cosmetic changes to whitespaces. * tests/obsolete.test: Enable `errexit' shell flag, with related changes. Improve verbosity. Other miscellanous changes. --- ChangeLog | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/mdate2.test | 11 ++++++++--- tests/mdate3.test | 15 ++++++++------- tests/mdate4.test | 17 ++++++++++------- tests/mkinstall.test | 8 +++++--- tests/nodist.test | 22 +++++++++++----------- tests/nodist3.test | 14 +++++++------- tests/noinst.test | 11 ++++++++--- tests/noinstdir.test | 11 +++++++---- tests/number.test | 11 ++++++++--- tests/objc.test | 10 +++++++--- tests/obsolete.test | 23 ++++++++++++++++------- tests/outdir.test | 10 +++++++--- tests/output.test | 15 +++++++++------ tests/output2.test | 17 ++++++++++------- tests/output3.test | 15 ++++++++++----- tests/output4.test | 17 ++++++++++------- tests/parse.test | 15 ++++++++------- tests/pluseq.test | 2 ++ tests/ppf77.test | 11 ++++++----- tests/req.test | 8 ++++++-- tests/rulepat.test | 10 +++++++--- tests/specflg3.test | 24 +++++++++++------------- tests/specflg6.test | 14 +++++++++----- tests/spell3.test | 8 ++++++-- tests/spelling.test | 15 +++++++++------ 26 files changed, 254 insertions(+), 129 deletions(-) diff --git a/ChangeLog b/ChangeLog index 934eba6..4b7e4bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,52 @@ +2010-08-22 Stefano Lattarini <stefano.lattar...@gmail.com> + + Enable `set -e' in more tests (plus some tweakings). + * tests/mkinstall.test: Enable `errexit' shell flag, and related + changes. Add a trailing `:' command, if needed. + * tests/mdate2.test: Likewise. + * tests/objc.test: Likewise. + * tests/noinst.test: Likewise. + * tests/outdir.test: Likewise. + * tests/number.test: Likewise. + * tests/pluseq.test: Likewise. + * tests/req.test: Likewise. + * tests/rulepat.test: Likewise. + * tests/specflg6.test: Likewise. + * tests/spell3.test: Likewise. + * tests/parse.test: Likewise, and ... + (configure.in): Use the stub created by ./defs, rather than + writing it from scratch. + * tests/mdate4.test: Likewise. + * tests/mkinstall.test: Likewise, and ... + (configure.in): ... drop useless call to `AC_OUTPUT'. + * tests/output.test: Enable `errexit' shell flag, and related + changes. Add a trailing `:' command. + (configure.in): Modernize. + * tests/output2.test: Likewise. + * tests/output3.test: Likewise. + * tests/output4.test: Likewise. + * tests/mdate3.test: Enable `errexit' shell flag, and related + changes. Prefer `$me' over hard-coded test name. Do not move + non-existent or useless files in the build auxiliary directory. + * tests/nodistdir.test: Enable `errexit' shell flag, and related + changes. Prefer trailing `:' over trailing `Exit 0'. + * tests/nodist.test: Likewise. Also, prefer cat + here-doc over + echo to create input test files, and do not create useless dummy + C source files. + * tests/nodist2.test: Likewise. + * tests/ppf77.test: Enable `errexit' shell flag, with related + changes. Add a trailing `:' command. Do not create useless + dummy source files. + * tests/spelling.test: Enable `errexit' shell flag, with related + changes. Add a trailing `:' command. Also, grep Automake error + message. + * tests/specflg3.test: Enable `errexit' shell flag, with related + changes. Avoid unportable use of `-e' option of fgrep. Prefer + trailing `:' over trailing `Exit 0'. Remove extra empty lines, + and cosmetic changes to whitespaces. + * tests/obsolete.test: Enable `errexit' shell flag, with related + changes. Improve verbosity. Other miscellanous changes. + 2010-08-18 Stefano Lattarini <stefano.lattar...@gmail.com> Fix potential regressions in depcomp{3,5}.test. diff --git a/tests/mdate2.test b/tests/mdate2.test index 11b6d5d..ae2524c 100755 --- a/tests/mdate2.test +++ b/tests/mdate2.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 1996, 1997, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 2001, 2002, 2010 Free Software Foundation, +# Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,6 +19,8 @@ . ./defs || Exit 1 +set -e + cat > Makefile.am << 'END' info_TEXINFOS = textutils.texi END @@ -32,7 +35,9 @@ END echo '@setfilename textutils' > textutils.texi # Use "././" to confuse Automake into thinking this is a subdir build. -$ACLOCAL || Exit 1 -$AUTOMAKE ././Makefile || Exit 1 +$ACLOCAL +$AUTOMAKE ././Makefile grep 'mdate-sh' Makefile.in | grep -v SHELL + +: diff --git a/tests/mdate3.test b/tests/mdate3.test index 75105f9..b487359 100755 --- a/tests/mdate3.test +++ b/tests/mdate3.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 1999, 2001, 2002, 2004 Free Software Foundation, Inc. +# Copyright (C) 1999, 2001, 2002, 2004, 2010 Free Software Foundation, +# Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,8 +19,10 @@ . ./defs || Exit 1 -cat > configure.in << 'END' -AC_INIT([mdate3], [1.0]) +set -e + +cat > configure.in << END +AC_INIT([$me], [1.0]) AC_CONFIG_AUX_DIR([foo]) AM_INIT_AUTOMAKE AC_CONFIG_FILES([Makefile]) @@ -41,11 +44,9 @@ mkdir foo : > foo/mdate-sh mv install-sh foo mv missing foo -mv mkinstalldirs foo -mv depcomp foo -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 +$ACLOCAL +$AUTOMAKE grep '[^/]mdate-sh' Makefile.in && Exit 1 Exit 0 diff --git a/tests/mdate4.test b/tests/mdate4.test index ca24f56..c9ef899 100755 --- a/tests/mdate4.test +++ b/tests/mdate4.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,10 +19,10 @@ . ./defs || Exit 1 -cat > configure.in << 'END' -AC_INIT -AM_INIT_AUTOMAKE(nonesuch, nonesuch) -AC_OUTPUT(Makefile sub/Makefile) +set -e + +cat >> configure.in << 'END' +AC_CONFIG_FILES([sub/Makefile]) END cat > Makefile.am << 'END' @@ -40,6 +40,9 @@ cat > sub/textutils.texi << 'END' @setfilename textutils.info END -$ACLOCAL || Exit 1 -$AUTOMAKE -a || Exit 1 +$ACLOCAL +$AUTOMAKE -a +ls -l sub test -f sub/mdate-sh + +: diff --git a/tests/mkinstall.test b/tests/mkinstall.test index 4a65307..8b426e8 100755 --- a/tests/mkinstall.test +++ b/tests/mkinstall.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1996, 2001, 2002, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,14 +18,16 @@ . ./defs || Exit 1 +set -e + cat > Makefile.am << 'END' pkgdata_DATA = END # The "././" prefix confuses Automake into thinking it is doing a # subdir build. Yes, this is hacky. -$ACLOCAL || Exit 1 -$AUTOMAKE ././Makefile || Exit 1 +$ACLOCAL +$AUTOMAKE ././Makefile grep ' /mkinstalldirs' Makefile.in && Exit 1 Exit 0 diff --git a/tests/nodist.test b/tests/nodist.test index 7239338..d2c2caf 100755 --- a/tests/nodist.test +++ b/tests/nodist.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1999, 2001, 2002, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,7 +18,11 @@ . ./defs || Exit 1 -echo AC_PROG_CC >> configure.in +set -e + +cat >> configure.in << 'END' +AC_PROG_CC +END cat > Makefile.am << 'END' bin_PROGRAMS = eyeball @@ -28,15 +32,11 @@ nodist_eyeball_SOURCES = b.c dist_eyeball_SOURCES = c.c END -: > a.c -: > b.c -: > c.c - -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 +$ACLOCAL +$AUTOMAKE -grep '^am_eyeball_OBJECTS' Makefile.in || Exit 1 -grep '^DIST_SOURCES =' Makefile.in || Exit 1 +grep '^am_eyeball_OBJECTS' Makefile.in +grep '^DIST_SOURCES =' Makefile.in grep '^DIST_SOURCES =.*nodist' Makefile.in && Exit 1 -Exit 0 +: diff --git a/tests/nodist3.test b/tests/nodist3.test index 21cfec3..c5470e7 100755 --- a/tests/nodist3.test +++ b/tests/nodist3.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,7 +18,9 @@ . ./defs || Exit 1 -echo AC_PROG_CC >> configure.in +cat >> configure.in << 'END' +AC_PROG_CC +END cat > Makefile.am << 'END' AUTOMAKE_OPTIONS = no-dist @@ -26,12 +28,10 @@ bin_PROGRAMS = eyeball eyeball_SOURCES = a.c END -: > a.c - -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 +$ACLOCAL +$AUTOMAKE grep '^dist:' Makefile.in && Exit 1 grep '^DIST_SOURCES =' Makefile.in && Exit 1 -Exit 0 +: diff --git a/tests/noinst.test b/tests/noinst.test index dd97481..075e05e 100755 --- a/tests/noinst.test +++ b/tests/noinst.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 1996, 1997, 1998, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 2001, 2002, 2010 Free Software +# Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,12 +20,16 @@ . ./defs || Exit 1 +set -e + cat > Makefile.am << 'END' all-local: exit 1 END -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 +$ACLOCAL +$AUTOMAKE grep '^install[-a-z]*:.* all' Makefile.in + +: diff --git a/tests/noinstdir.test b/tests/noinstdir.test index 3f33c32..b91ac32 100755 --- a/tests/noinstdir.test +++ b/tests/noinstdir.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,6 +19,8 @@ . ./defs || Exit 1 +set -e + cat > Makefile.am << 'END' noinst_SCRIPTS = foo.sh noinst_DATA = foo.xpm @@ -37,9 +39,10 @@ AC_PROG_CC AC_PROG_RANLIB END -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 +$ACLOCAL +$AUTOMAKE grep 'noinstdir' Makefile.in && Exit 1 grep 'checkdir' Makefile.in && Exit 1 -Exit 0 + +: diff --git a/tests/number.test b/tests/number.test index a43ff2f..b764519 100755 --- a/tests/number.test +++ b/tests/number.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1996, 2001, 2002, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,6 +19,8 @@ . ./defs || Exit 1 +set -e + cat >> configure.in << 'END' AC_PROG_CC END @@ -27,8 +29,11 @@ cat > Makefile.am << 'END' bin_PROGRAMS = zardoz END -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 +$ACLOCAL +$AUTOMAKE +grep '^zardoz_OBJECTS' Makefile.in count=`grep -c '^zardoz_OBJECTS' Makefile.in` test $count -eq 1 + +: diff --git a/tests/objc.test b/tests/objc.test index facc4d4..0c55f7a 100755 --- a/tests/objc.test +++ b/tests/objc.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2006, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,6 +19,8 @@ . ./defs || Exit 1 +set -e + cat >> configure.in << 'END' AC_PROG_OBJC END @@ -28,7 +30,9 @@ bin_PROGRAMS = hello hello_SOURCES = hello.m END -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 +$ACLOCAL +$AUTOMAKE grep '^\.SUFFIXES:.*\.m' Makefile.in + +: diff --git a/tests/obsolete.test b/tests/obsolete.test index 337e4db..6c969dc 100755 --- a/tests/obsolete.test +++ b/tests/obsolete.test @@ -23,6 +23,8 @@ set x ${AUTOUPDATE-autoupdate} required=$2 . ./defs || Exit 1 +set -e + cat > configure.in << 'END' AC_INIT END @@ -30,22 +32,29 @@ END $PERL -ne '/AU_DEFUN\(\[(\w+)\]/ && print "$1\n"' \ "$testsrcdir/../m4/obsolete.m4" >> obs cat obs >> configure.in -$PERL -ne 'chomp; print "grep $_ stderr || Exit 1\n"; ' obs > obs.1 +$PERL -ne 'chomp; print "grep $_ output || Exit 1\n"; ' obs > obs.1 $PERL -ne 'chomp; print "grep $_ configure.in && Exit 1\n"; ' obs > obs.2 +echo : >> obs.1 # since it will be sourced, it must and with a success +echo : >> obs.2 # ditto + +cat configure.in # for debugging +cat obs.1 # ditto +cat obs.2 # ditto # Sanity check. Make sure we have added something to configure.in. -test `cat configure.in | wc -l` -gt 1 || Exit 1 +test `wc -l <configure.in` -gt 1 -$ACLOCAL || Exit 1 +$ACLOCAL # Expect Autoconf to complain about each of the macros in obs. -$AUTOCONF -Wobsolete >stderr 2>&1 +$AUTOCONF -Wobsolete >output 2>&1 || { cat output; Exit 1; } +cat output . ./obs.1 # Make sure Autoupdate remove each of these macros. -$AUTOUPDATE || Exit 1 +$AUTOUPDATE . ./obs.2 # Autoconf should be able to grok the updated configure.in. -$AUTOCONF || Exit 1 +$AUTOCONF -Exit 0 +: diff --git a/tests/outdir.test b/tests/outdir.test index 4bafb4e..5472aa6 100755 --- a/tests/outdir.test +++ b/tests/outdir.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1996, 2001, 2002, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,14 +19,18 @@ . ./defs || Exit 1 +set -e + cat > Makefile.am <<'END' pkgdata_DATA = END mkdir zardir -$ACLOCAL || Exit 1 -$AUTOMAKE -Wno-obsolete --output-dir=zardir || Exit 1 +$ACLOCAL +$AUTOMAKE -Wno-obsolete --output-dir=zardir test -f Makefile.in && Exit 1 test -f zardir/Makefile.in + +: diff --git a/tests/output.test b/tests/output.test index 4f6a7cd..3931fc5 100755 --- a/tests/output.test +++ b/tests/output.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 1996, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1996, 2000, 2001, 2002, 2010 Free Software Foundation, +# Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,10 +19,10 @@ . ./defs || Exit 1 -cat > configure.in << 'END' -AC_INIT -AM_INIT_AUTOMAKE(nonesuch, nonesuch) -AC_OUTPUT(Makefile frob/zardoz) +cat > configure.in <<END +AC_INIT([$me], [1.0]) +AM_INIT_AUTOMAKE +AC_OUTPUT([Makefile frob/zardoz]) END : > Makefile.am @@ -29,5 +30,7 @@ END mkdir frob : > frob/zardoz.in -$ACLOCAL || Exit 1 +$ACLOCAL $AUTOMAKE + +: diff --git a/tests/output2.test b/tests/output2.test index c9bdbc3..df1c4c3 100755 --- a/tests/output2.test +++ b/tests/output2.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 1996, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1996, 2000, 2001, 2002, 2010 Free Software Foundation, +# Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,10 +19,12 @@ . ./defs || Exit 1 -cat > configure.in << 'END' -AC_INIT -AM_INIT_AUTOMAKE(nonesuch, nonesuch) -AC_OUTPUT(Makefile intl/intlh.inst po/Makefile.in misc/gettextize) +set -e + +cat > configure.in <<END +AC_INIT([$me], [1.0]) +AM_INIT_AUTOMAKE +AC_OUTPUT([Makefile intl/intlh.inst po/Makefile.in misc/gettextize]) END : > Makefile.am @@ -31,8 +34,8 @@ mkdir intl po misc : > po/Makefile.in.am : > misc/gettextize.in -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 +$ACLOCAL +$AUTOMAKE grep '^gettextize' Makefile.in && Exit 1 Exit 0 diff --git a/tests/output3.test b/tests/output3.test index 02d7e6f..3c8e79b 100755 --- a/tests/output3.test +++ b/tests/output3.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 1996, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1996, 2000, 2001, 2002, 2010 Free Software Foundation, +# Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,9 +19,11 @@ . ./defs || Exit 1 -cat > configure.in << 'END' -AC_INIT -AM_INIT_AUTOMAKE(nonesuch, nonesuch) +set -e + +cat > configure.in <<END +AC_INIT([$me], [1.0]) +AM_INIT_AUTOMAKE AC_OUTPUT([Makefile tests/Makefile tests/defs], [blah]) @@ -32,5 +35,7 @@ mkdir tests : > tests/Makefile.am : > tests/defs.in -$ACLOCAL || Exit 1 +$ACLOCAL $AUTOMAKE + +: diff --git a/tests/output4.test b/tests/output4.test index fc5a022..4ea75b5 100755 --- a/tests/output4.test +++ b/tests/output4.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 1996, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1996, 2000, 2001, 2002, 2010 Free Software Foundation, +# Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,18 +19,20 @@ . ./defs || Exit 1 -cat > configure.in << 'END' -AC_INIT -AM_INIT_AUTOMAKE(nonesuch, nonesuch) -AC_OUTPUT(tests/Makefile tests/defs) +set -e + +cat > configure.in <<END +AC_INIT([$me], [1.0]) +AM_INIT_AUTOMAKE +AC_OUTPUT([tests/Makefile tests/defs]) END mkdir tests : > tests/defs.in : > tests/Makefile.am -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 +$ACLOCAL +$AUTOMAKE grep tests/defs.in tests/Makefile.in && Exit 1 Exit 0 diff --git a/tests/parse.test b/tests/parse.test index e7dcbe5..09f27a2 100755 --- a/tests/parse.test +++ b/tests/parse.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1998, 2000, 2001, 2002, 2010 Free Software Foundation, +# Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,12 +19,12 @@ . ./defs || Exit 1 -cat > configure.in << 'END' -AC_INIT -AM_INIT_AUTOMAKE(nonesuch, nonesuch) +set -e + +cat >> configure.in << 'END' AC_PROG_CC AC_PROG_RANLIB -AC_OUTPUT(Makefile) +AC_OUTPUT END cat > Makefile.am << 'END' @@ -33,8 +34,8 @@ zar.c\ doz.c END -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 +$ACLOCAL +$AUTOMAKE $FGREP zar.cdoz Makefile.in && Exit 1 Exit 0 diff --git a/tests/pluseq.test b/tests/pluseq.test index 66eec8f..5cfa873 100755 --- a/tests/pluseq.test +++ b/tests/pluseq.test @@ -18,6 +18,8 @@ . ./defs || Exit 1 +set -e + cat > Makefile.am << 'END' data_DATA = zar data_DATA += doz diff --git a/tests/ppf77.test b/tests/ppf77.test index 6c61a2e..aaeedcb 100755 --- a/tests/ppf77.test +++ b/tests/ppf77.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1999, 2001, 2002, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,6 +19,8 @@ . ./defs || Exit 1 +set -e + cat >> configure.in << 'END' AC_PROG_F77 END @@ -28,8 +30,7 @@ bin_PROGRAMS = ppf ppf_SOURCES = foo.F q.r END -: > foo.F -: > q.r - -$ACLOCAL || Exit 1 +$ACLOCAL $AUTOMAKE + +: diff --git a/tests/req.test b/tests/req.test index 39bf349..3d89cf9 100755 --- a/tests/req.test +++ b/tests/req.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1996, 2001, 2002, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,6 +18,8 @@ . ./defs || Exit 1 +set -e + cat > configure.in <<EOF AC_INIT AM_INIT_GUILE_MODULE @@ -32,6 +34,8 @@ module=[$1] AC_SUBST(module)]) END -$ACLOCAL || Exit 1 +$ACLOCAL grep 'DEFUN.*INIT_AUTOMAKE' aclocal.m4 + +: diff --git a/tests/rulepat.test b/tests/rulepat.test index c15e910..06b0c89 100755 --- a/tests/rulepat.test +++ b/tests/rulepat.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1996, 2001, 2002, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,11 +18,15 @@ . ./defs || Exit 1 +set -e + cat > Makefile.am << 'END' $(srcdir)/Makefile.am: END -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 +$ACLOCAL +$AUTOMAKE grep '^$(srcdir)/Makefile\.am' Makefile.in + +: diff --git a/tests/specflg3.test b/tests/specflg3.test index 60006a5..40a383a 100755 --- a/tests/specflg3.test +++ b/tests/specflg3.test @@ -19,12 +19,12 @@ . ./defs || Exit 1 -cat > configure.in << 'END' -AC_INIT -AM_INIT_AUTOMAKE(test, 0.1) +set -e + +cat >> configure.in << 'END' AC_PROG_CC AM_PROG_CC_C_O -AC_OUTPUT(Makefile) +AC_OUTPUT END cat > Makefile.am << 'END' @@ -35,14 +35,12 @@ END : > compile -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 - -$FGREP -e '-o foo-foo' Makefile.in || Exit 1 - -$FGREP 'foo.o.o' Makefile.in && Exit 1 -$FGREP 'foo.$(OBJEXT).$(OBJEXT)' Makefile.in && Exit 1 +$ACLOCAL +$AUTOMAKE -$FGREP '$(foo_CFLAGS)' Makefile.in || Exit 1 +$FGREP ' -o foo-foo' Makefile.in +$FGREP 'foo.o.o' Makefile.in && Exit 1 +$FGREP 'foo.$(OBJEXT).$(OBJEXT)' Makefile.in && Exit 1 +$FGREP '$(foo_CFLAGS)' Makefile.in -Exit 0 +: diff --git a/tests/specflg6.test b/tests/specflg6.test index d858769..2300142 100755 --- a/tests/specflg6.test +++ b/tests/specflg6.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2004, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,10 +20,12 @@ . ./defs || Exit 1 +set -e + cat >> configure.in << 'END' AC_PROG_CC AM_PROG_CC_C_O -AM_CONDITIONAL(BAR, true) +AM_CONDITIONAL([BAR], [true]) END cat > Makefile.am << 'END' @@ -38,8 +40,8 @@ END : > compile -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 +$ACLOCAL +$AUTOMAKE uncondval=`$FGREP 'foo-foo.o: foo.c' Makefile.in` @@ -47,8 +49,10 @@ cat >> Makefile.am << 'END' foo_SOURCES += $(BAR_SRCS) END -$AUTOMAKE || Exit 1 +$AUTOMAKE condval=`$FGREP 'foo-foo.o: foo.c' Makefile.in` test "x$uncondval" = "x$condval" + +: diff --git a/tests/spell3.test b/tests/spell3.test index 399328f..ac52582 100755 --- a/tests/spell3.test +++ b/tests/spell3.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1996, 2001, 2002, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,11 +19,15 @@ . ./defs || Exit 1 +set -e + cat > Makefile.am << 'END' TAGS_DEPENDENCIES = joe ## Required to avoid error. ETAGS_ARGS = joe END -$ACLOCAL || Exit 1 +$ACLOCAL $AUTOMAKE + +: diff --git a/tests/spelling.test b/tests/spelling.test index ad1e232..3b423cf 100755 --- a/tests/spelling.test +++ b/tests/spelling.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1996, 2001, 2002, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,12 +18,15 @@ . ./defs || Exit 1 +set -e + cat > Makefile.am << 'EOF' bni_PROGRAMS = zot EOF -if $ACLOCAL || Exit 1 -$AUTOMAKE; then - Exit 1 -fi -Exit 0 +$ACLOCAL +AUTOMAKE_fails +grep 'bni_PROGRAMS' stderr +grep 'bnidir.*undefined' stderr + +: -- 1.7.1