]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Modernize, improve and/or tweak some test scripts.
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 14 Jun 2010 15:40:42 +0000 (17:40 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 25 Nov 2010 13:48:21 +0000 (14:48 +0100)
* 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
tests/maintclean.test
tests/make.test
tests/makej.test
tests/makevars.test
tests/sinclude.test
tests/space.test
tests/version7.test

index 2cbce3be1b6be6fc755d838e7aa02c9f4488b446..cea4d572a8e3e55f6adeec8bc1ed06fe7e0e4c96 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2010-11-25  Stefano Lattarini  <stefano.lattarini@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-11-21  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Tests: consistently use "|| Exit 1" after ". ./defs".
index a66464b03ca6ebb95c5626049c9950a91d58c8eb..e4f09fd5c1a6c0b9dcb90cf91399808d5b00eb7f 100755 (executable)
@@ -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
+
+:
index 1e3184ddd5f8d3698b3dca8f739e791eff57524c..f866b3132452e6e1dc52037037a4f987ea57afaf 100755 (executable)
@@ -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
 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
 
index e5d55a107c4fbfe15e2f4c4ccc5b3b3505d5c59c..d85be0f0d0b628614d94c2e790cdd3f86dc93bc0 100755 (executable)
@@ -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'
+
+:
index f4a80aaf97f636ddb693dc63924ed599c50f30a6..31fdd56d07c2adb7b1ea3385e83eb2dcfc683782 100755 (executable)
@@ -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
 
 . ./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
+:
index cc8898be6a9a35ecb975f31d8817ebb02ca07fd1..7aff5257ebc76fa54405da0e78ebf1b1b792d6e1 100755 (executable)
@@ -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
+
+:
index a4ab5a8006a835b7581423b99f9e4ce99bf45acb..05a90dd15bb08d3668003c4bca29cd61565b56b2 100755 (executable)
@@ -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
index 4df84edfc74d342db702c7538f8df30e541ef239..a87b2b81e6119d464281dfafca6368b008c6119b 100755 (executable)
@@ -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
+
+: