Hello automakers. Another testsuite-tweaking patch that was bit-rotting on my local repository.
Regards, Stefano -*-*-*- Modernize, improve and/or tweak some test scripts. * tests/maintclean.test: Use proper m4 quoting. Add trailing `:' command. * tests/sinclude.test: Likewise, and add a couple of blank lines, for clarity. * tests/make.test: Move setting of `errexit' shell flag earlier in the script (just after inclusion of ./defs). Use the configure.in stub created by ./defs, rather than writing it from scratch. Some cosmetic changes in spacing. Ensure we wait enough time before touching configure.in to trigger the rebuild rules. * tests/makej.test: Use `$me' instead of hard-coding the test name. Add trailing `:' command. * tests/version7.test: Likewise. * tests/space.test: Enable `errexit' shell flag, and related changes. * tests/makevars.test: Likewise. Also, prefer trailing `:' over trailing `Exit 0', and be more tolerant of white spaces when grepping Makefile.in. --- ChangeLog | 21 +++++++++++++++++++++ tests/maintclean.test | 6 ++++-- tests/make.test | 17 ++++++----------- tests/makej.test | 8 +++++--- tests/makevars.test | 12 +++++++----- tests/sinclude.test | 20 ++++++++++++-------- tests/space.test | 6 ++++-- tests/version7.test | 9 +++++---- 8 files changed, 64 insertions(+), 35 deletions(-)
From f8f169cd1a115e7eb5af0929c921bda8e0a39789 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Mon, 14 Jun 2010 17:40:42 +0200 Subject: [PATCH] Modernize, improve and/or tweak some test scripts. * tests/maintclean.test: Use proper m4 quoting. Add trailing `:' command. * tests/sinclude.test: Likewise, and add a couple of blank lines, for clarity. * tests/make.test: Move setting of `errexit' shell flag earlier in the script (just after inclusion of ./defs). Use the configure.in stub created by ./defs, rather than writing it from scratch. Some cosmetic changes in spacing. Ensure we wait enough time before touching configure.in to trigger the rebuild rules. * tests/makej.test: Use `$me' instead of hard-coding the test name. Add trailing `:' command. * tests/version7.test: Likewise. * tests/space.test: Enable `errexit' shell flag, and related changes. * tests/makevars.test: Likewise. Also, prefer trailing `:' over trailing `Exit 0', and be more tolerant of white spaces when grepping Makefile.in. --- ChangeLog | 21 +++++++++++++++++++++ tests/maintclean.test | 6 ++++-- tests/make.test | 17 ++++++----------- tests/makej.test | 8 +++++--- tests/makevars.test | 12 +++++++----- tests/sinclude.test | 20 ++++++++++++-------- tests/space.test | 6 ++++-- tests/version7.test | 9 +++++---- 8 files changed, 64 insertions(+), 35 deletions(-) diff --git a/ChangeLog b/ChangeLog index 934eba6..38bcece 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2010-08-20 Stefano Lattarini <stefano.lattar...@gmail.com> + + Modernize, improve and/or tweak some test scripts. + * tests/maintclean.test: Use proper m4 quoting. Add trailing `:' + command. + * tests/sinclude.test: Likewise, and add a couple of blank lines, + for clarity. + * tests/make.test: Move setting of `errexit' shell flag earlier in + the script (just after inclusion of ./defs). Use the configure.in + stub created by ./defs, rather than writing it from scratch. Some + cosmetic changes in spacing. Ensure we wait enough time before + touching configure.in to trigger the rebuild rules. + * tests/makej.test: Use `$me' instead of hard-coding the test + name. Add trailing `:' command. + * tests/version7.test: Likewise. + * tests/space.test: Enable `errexit' shell flag, and related + changes. + * tests/makevars.test: Likewise. Also, prefer trailing `:' over + trailing `Exit 0', and be more tolerant of white spaces when + grepping Makefile.in. + 2010-08-18 Stefano Lattarini <stefano.lattar...@gmail.com> Fix potential regressions in depcomp{3,5}.test. diff --git a/tests/maintclean.test b/tests/maintclean.test index a66464b..e4f09fd 100755 --- a/tests/maintclean.test +++ b/tests/maintclean.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 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 @@ -21,7 +21,7 @@ set -e cat >> configure.in << 'END' -AC_CONFIG_FILES(bar) +AC_CONFIG_FILES([bar]) AC_OUTPUT END @@ -74,3 +74,5 @@ test ! -f foo.c test ! -f Makefile test ! -f config.status test ! -d autom4te.cache + +: diff --git a/tests/make.test b/tests/make.test index 1e3184d..f866b31 100755 --- a/tests/make.test +++ b/tests/make.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 @@ -20,17 +20,15 @@ required=GNUmake . ./defs || Exit 1 -cat > configure.in << 'END' -AC_INIT(Makefile.am) -AM_INIT_AUTOMAKE(foo,0,no) +set -e + +cat >> configure.in << 'END' AM_MAKE_INCLUDE -AC_OUTPUT(Makefile) +AC_OUTPUT END : > Makefile.am -set -e - $ACLOCAL $AUTOCONF $AUTOMAKE @@ -45,14 +43,11 @@ export AUTOMAKE save="$MAKE" for flag in '' -w; do MAKE="$save $flag" ./configure - $FGREP 'am__include = include' Makefile - + $sleep touch configure.in $MAKE $flag - $FGREP 'am__include = include' Makefile - rm -f config.cache done diff --git a/tests/makej.test b/tests/makej.test index e5d55a1..d85be0f 100755 --- a/tests/makej.test +++ b/tests/makej.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 2003, 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 @@ -26,9 +26,9 @@ required=GNUmake set -e -cat >configure.in <<'END' +cat >configure.in <<END m4_include([version.m4]) -AC_INIT([version7], [THE_VERSION]) +AC_INIT([$me], [THE_VERSION]) AM_INIT_AUTOMAKE AC_CONFIG_HEADER([config.h]) AC_CONFIG_FILES([Makefile]) @@ -51,3 +51,5 @@ $sleep echo 'm4_define([THE_VERSION], [3.141])' > version.m4 $MAKE -j ./configure --version | grep '3\.141' + +: diff --git a/tests/makevars.test b/tests/makevars.test index f4a80aa..31fdd56 100755 --- a/tests/makevars.test +++ b/tests/makevars.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,15 +19,17 @@ . ./defs || Exit 1 +set -e + # Find the macros wanted by Automake. -$ACLOCAL || Exit 1 +$ACLOCAL # Create some dummy Makefile.in. : > Makefile.am -$AUTOMAKE || Exit 1 +$AUTOMAKE # We are definitely not needing a compiler or preprocessor. -$EGREP '^(CC|CPP|CXX|CXXCPP) =' Makefile.in && Exit 1 +$EGREP '^ *(CC|CPP|CXX|CXXCPP) *=' Makefile.in && Exit 1 -Exit 0 +: diff --git a/tests/sinclude.test b/tests/sinclude.test index cc8898b..7aff525 100755 --- a/tests/sinclude.test +++ b/tests/sinclude.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 1998, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 1998, 2001, 2002, 2003, 2005, 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 @@ -31,27 +32,28 @@ sinclude([doesntexist.m4]) EOF mkdir sub + cat > sub/p.m4 << 'END' -AC_SUBST(MAGICALPIG) +AC_SUBST([MAGICALPIG]) END cat > sub/h.m4 << 'END' -AC_SUBST(MAGICALHOG) +AC_SUBST([MAGICALHOG]) END cat > sub/g.m4 << 'END' -AC_SUBST(GREPME) +AC_SUBST([GREPME]) END : > Makefile.am -echo 'sinclude(sub/g.m4)' >> acinclude.m4 -echo 'm4_sinclude(sub/doesntexist.m4)' >> acinclude.m4 +echo 'sinclude([sub/g.m4])' >> acinclude.m4 +echo 'm4_sinclude([sub/doesntexist.m4])' >> acinclude.m4 $ACLOCAL -echo 'm4_sinclude(sub/p.m4)' >> aclocal.m4 -echo 'm4_include(sub/h.m4)' >> aclocal.m4 +echo 'm4_sinclude([sub/p.m4])' >> aclocal.m4 +echo 'm4_include([sub/h.m4])' >> aclocal.m4 $AUTOMAKE @@ -59,3 +61,5 @@ grep doesntexist Makefile.in && Exit 1 grep MAGICALPIG Makefile.in grep MAGICALHOG Makefile.in grep GREPME Makefile.in + +: diff --git a/tests/space.test b/tests/space.test index a4ab5a8..05a90dd 100755 --- a/tests/space.test +++ b/tests/space.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 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,6 +18,8 @@ . ./defs || Exit 1 +set -e + echo AC_PROG_CC >> configure.in cat > Makefile.am << 'END' @@ -25,5 +27,5 @@ cat > Makefile.am << 'END' foo_SOURCES = foo.c END -$ACLOCAL || Exit 1 +$ACLOCAL $AUTOMAKE diff --git a/tests/version7.test b/tests/version7.test index 4df84ed..a87b2b8 100755 --- a/tests/version7.test +++ b/tests/version7.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2002, 2008 Free Software Foundation, Inc. +# Copyright (C) 2002, 2008, 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 @@ -24,9 +24,9 @@ required='makeinfo tex texi2dvi GNUmake' set -e -cat >configure.in <<'END' +cat >configure.in <<END m4_include([version.m4]) -AC_INIT([version7], [THE_VERSION]) +AC_INIT([$me], [THE_VERSION]) AM_INIT_AUTOMAKE AC_CONFIG_FILES([Makefile]) AC_OUTPUT @@ -59,9 +59,10 @@ $AUTOMAKE --add-missing $MAKE grep '2\.718' version.texi - $sleep echo 'm4_define([THE_VERSION], [3.141])' > version.m4 $MAKE distcheck ./configure --version | grep '3\.141' grep '3\.141' version.texi + +: -- 1.7.1