]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Modernize, improve and/or fix tests `pluseq*.test.
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 10 Jun 2010 06:34:00 +0000 (08:34 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 12 Jun 2010 11:32:17 +0000 (13:32 +0200)
* tests/pluseq5.test: Append to configure.in using cat with an
here-doc, not using echo.
* tests/pluseq10.test: Make sure that the captured output of
`make' command is always displayed. Where possible, use $FGREP
instead of grep (this change makes some checks slighty stricter).
* tests/pluseq8.test: Enable `errexit' shell flag, with related
changes.
* tests/pluseq.test: Likewise.  Also, do not create useless dummy
data files, and use better m4 quoting in generated configure.in.
* tests/pluseq2.test: Likewise.  Also, append to configure.in
using cat with an here-doc, not using echo.
* tests/pluseq3.test: Likewise.
* tests/pluseq4.test: Likewise.
* tests/pluseq6.test: Likewise.
* tests/pluseq7.test: Do not create useless dummy source file.
* tests/pluseq9.test: Slighty extended w.r.t. the grepping of
Automake stderr.  Some unrelated cosmetic changes.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
tests/pluseq.test
tests/pluseq10.test
tests/pluseq2.test
tests/pluseq3.test
tests/pluseq4.test
tests/pluseq5.test
tests/pluseq6.test
tests/pluseq7.test
tests/pluseq8.test
tests/pluseq9.test

index b571cf295b632fdb7573087006163c6e7e8d3e86..d81810377c481f2f09eda2e8d4d5fa2e7ffaa28c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,24 @@
 2010-06-12  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
+       Modernize, improve and/or fix tests `pluseq*.test.
+       * tests/pluseq5.test: Append to configure.in using cat with an
+       here-doc, not using echo.
+       * tests/pluseq10.test: Make sure that the captured output of
+       `make' command is always displayed. Where possible, use $FGREP
+       instead of grep (this change makes some checks slighty stricter).
+       * tests/pluseq8.test: Enable `errexit' shell flag, with related
+       changes.
+       * tests/pluseq.test: Likewise.  Also, do not create useless dummy
+       data files, and use better m4 quoting in generated configure.in.
+       * tests/pluseq2.test: Likewise.  Also, append to configure.in
+       using cat with an here-doc, not using echo.
+       * tests/pluseq3.test: Likewise.
+       * tests/pluseq4.test: Likewise.
+       * tests/pluseq6.test: Likewise.
+       * tests/pluseq7.test: Do not create useless dummy source file.
+       * tests/pluseq9.test: Slighty extended w.r.t. the grepping of
+       Automake stderr.  Some unrelated cosmetic changes.
+
        Testsuite: ensure verbose printing of captured stderr.
        * tests/acloca18.test: Print captured stderr before either failing
        or grepping it.  Be sure to send captured stderr to stderr, not to
index 05a5fce7170f126e9cc8146984a2a791b945ee97..66eec8f31100c5530a4dabd0c702c88d7f9e25bf 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -23,9 +23,8 @@ data_DATA = zar
 data_DATA += doz
 END
 
-: > zar
-: > doz
-
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 $FGREP 'zar doz' Makefile.in
+
+:
index 5548e6dfc6e910a289ee2245332718444162639d..92734155dced927e916eeb8ffe941081a9a1094b 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
 
 set -e
 
-cat >>configure.in <<EOF
-AM_CONDITIONAL(A, true)
-AM_CONDITIONAL(B, false)
+cat >>configure.in << 'END'
+AM_CONDITIONAL([A], [true])
+AM_CONDITIONAL([B], [false])
 AC_OUTPUT
-EOF
+END
 
 cat > Makefile.am << 'END'
 foo =  0.h
@@ -40,6 +40,7 @@ foo += b0.h \
   b1.h
 endif
 
+.PHONY: print
 print:
        @echo BEG: $(foo) :END
 END
@@ -47,7 +48,10 @@ END
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
+
 ./configure
-$MAKE print >stdout
+$MAKE print >stdout || { cat stdout; Exit 1; }
 cat stdout
-grep 'BEG: 0.h a0.h a1.h a2.h a3.h :END' stdout
+$FGREP 'BEG: 0.h a0.h a1.h a2.h a3.h :END' stdout
+
+:
index 28f9848c5deeb2fe29c56addd7d9afce34f7ad8f..f9db345a009a861aec97ddbf11bc7e3595a80bf4 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998, 1999, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1998, 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
 
 . ./defs || Exit 1
 
-echo 'AM_CONDITIONAL(CHECK, true)' >> configure.in
+set -e
+
+cat >> configure.in << 'END'
+AM_CONDITIONAL([CHECK], [true])
+END
 
 cat > Makefile.am << 'END'
 
@@ -36,11 +41,9 @@ endif
 
 END
 
-: > zar
-: > doz
-: > dog
-
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
-grep 'CHECK_TRUE.*zar doz' Makefile.in || Exit 1
+$ACLOCAL
+$AUTOMAKE
+grep 'CHECK_TRUE.*zar doz' Makefile.in
 grep 'CHECK_FALSE.*dog' Makefile.in
+
+:
index 64ddd6902bc8a1e05a96b1673073f58e328449e3..755002c4d09626b516a94e44a0d22ad1cb01e303 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998, 1999, 2001, 2002, 2004  Free Software Foundation, Inc.
+# Copyright (C) 1998, 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
 
 . ./defs || Exit 1
 
-echo 'AM_CONDITIONAL(CHECK, true)' >> configure.in
+set -e
+
+cat >> configure.in << 'END'
+AM_CONDITIONAL([CHECK], [true])
+END
 
 cat > Makefile.am << 'END'
 
@@ -37,13 +42,7 @@ endif
 
 END
 
-: > zar
-: > doz
-: > dog
-
-set -e
-
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
 
 grep '^@CHECK_TRUE@data_DATA = zarrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr \\$' Makefile.in
@@ -51,4 +50,4 @@ grep '^@CHECK_TRUE@   doz$' Makefile.in
 
 grep '^@CHECK_FALSE@data_DATA = dog$' Makefile.in
 
-Exit 0
+:
index febc33bd012dff9d67123b9986ce306a707474f2..744b4899b9a228191f62229d01820b791e3fae66 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
 
 . ./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 = foo
 CC += -Dwhatever
 END
 
-: > foo.c
-
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 $FGREP '@CC@ -Dwhatever' Makefile.in
+
+:
index 1f1c98cfc701afc608aea7cf031bf481b91f9f04..4e03d37a30fc6b5ac6107b80f0663b0791d6cc51 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1999, 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
@@ -20,7 +21,9 @@
 
 set -e
 
-echo 'AM_CONDITIONAL(CHECK, true)' >> configure.in
+cat >> configure.in << 'END'
+AM_CONDITIONAL([CHECK], [true])
+END
 
 cat > Makefile.am << 'END'
 if CHECK
@@ -56,3 +59,5 @@ AUTOMAKE_fails
 grep AM_CPPFLAGS stderr && Exit 1
 # !CHECK should still be mentioned.
 grep ':.*!CHECK$' stderr
+
+:
index bb546cfb04cd3359f12c84db59fe254a6c211bba..af052390045abc4b036cb32243f65f9e44958ec8 100755 (executable)
@@ -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
 
 . ./defs || Exit 1
 
-echo 'AC_SUBST(ZZZ)' >> configure.in
+set -e
+
+cat >> configure.in << 'END'
+AC_SUBST([ZZZ])
+END
 
 # If you do this in a real Makefile.am, I will kill you.
 cat > Makefile.am << 'END'
@@ -26,9 +30,11 @@ mandir += foo
 zq = zzz
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
-$FGREP '@mandir@ foo' Makefile.in || Exit 1
+$ACLOCAL
+$AUTOMAKE
+$FGREP '@mandir@ foo' Makefile.in
 
 num=`grep '^mandir =' Makefile.in | wc -l`
 test $num -eq 1
+
+:
index f74e62c0b760b8fec0b019e4e25e3b7a49c3d5ba..071646208b3ed416586964bf465182174059177b 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1999, 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
@@ -32,8 +33,8 @@ libq_a_SOURCES = q.c
 AR += qq
 END
 
-: > q.c
-
 $ACLOCAL
 AUTOMAKE_fails
 grep 'Makefile.am:3:.*AR' stderr
+
+:
index a39059aaf4ba9458c0af18145613c55e0cf65d8f..901f8b641c6ac38dce576e1ea03eaa6c9ff08611 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2004, 2006  Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2004, 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
@@ -18,6 +19,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 VAR = \
     one \
@@ -25,8 +28,8 @@ VAR = \
 VAR += three
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 sed -n -e '/^VAR =/ {
    :loop
@@ -39,3 +42,5 @@ sed -n -e '/^VAR =/ {
     p
     n
    }' Makefile.in | grep three
+
+:
index 31e1c8d8d9775d3b93af88747d571d169440a9f6..fb30a1d8b7d72081933abb51ccfacb92da5d85fd 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 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
 
 set -e
 
-cat >>configure.in <<EOF
-AM_CONDITIONAL(COND1, true)
-AM_CONDITIONAL(COND2, true)
-AM_CONDITIONAL(COND3, true)
-EOF
+cat >>configure.in << 'END'
+AM_CONDITIONAL([COND1], [true])
+AM_CONDITIONAL([COND2], [true])
+AM_CONDITIONAL([COND3], [true])
+END
 
 cat > Makefile.am << 'END'
 if COND1
@@ -65,6 +65,9 @@ AUTOMAKE_fails
 # COND1_FALSE (merging the last two conditions), so we'll support
 # this case in the check too.
 
+grep '[cC]annot apply.*+=' stderr
 grep ':   !COND1 and !COND3$' stderr
 # Make sure there is exactly one missing condition.
 test `grep ':  ' stderr | wc -l` = 1
+
+: