automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Modernize, improve and/or fix tests `pluseq*.test.


From: Stefano Lattarini
Subject: [PATCH] Modernize, improve and/or fix tests `pluseq*.test.
Date: Fri, 11 Jun 2010 17:35:58 +0200
User-agent: KMail/1.12.1 (Linux/2.6.30-2-686; KDE/4.3.4; i686; ; )

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.
---
 ChangeLog           |   19 +++++++++++++++++++
 tests/pluseq.test   |   11 +++++------
 tests/pluseq10.test |   18 +++++++++++-------
 tests/pluseq2.test  |   21 ++++++++++++---------
 tests/pluseq3.test  |   19 +++++++++----------
 tests/pluseq4.test  |   16 ++++++++++------
 tests/pluseq5.test  |    6 +++++-
 tests/pluseq6.test  |   16 +++++++++++-----
 tests/pluseq7.test  |    7 ++++---
 tests/pluseq8.test  |   11 ++++++++---
 tests/pluseq9.test  |   13 ++++++++-----
 11 files changed, 102 insertions(+), 55 deletions(-)
From b414f8f314d43566eabc5bd4305bf11cad071641 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Thu, 10 Jun 2010 08:34:00 +0200
Subject: [PATCH] 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.
---
 ChangeLog           |   19 +++++++++++++++++++
 tests/pluseq.test   |   11 +++++------
 tests/pluseq10.test |   18 +++++++++++-------
 tests/pluseq2.test  |   21 ++++++++++++---------
 tests/pluseq3.test  |   19 +++++++++----------
 tests/pluseq4.test  |   16 ++++++++++------
 tests/pluseq5.test  |    6 +++++-
 tests/pluseq6.test  |   16 +++++++++++-----
 tests/pluseq7.test  |    7 ++++---
 tests/pluseq8.test  |   11 ++++++++---
 tests/pluseq9.test  |   13 ++++++++-----
 11 files changed, 102 insertions(+), 55 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6b927ba..fba2438 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,24 @@
 2010-06-11  Stefano Lattarini  <address@hidden>
 
+       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.
+
        Improve determination of PATH separator in bootstrap script.
        * bootstrap: Detemine what the PATH separator is the same way
        autoconf does.
diff --git a/tests/pluseq.test b/tests/pluseq.test
index 05a5fce..66eec8f 100755
--- a/tests/pluseq.test
+++ b/tests/pluseq.test
@@ -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
+
+:
diff --git a/tests/pluseq10.test b/tests/pluseq10.test
index 5548e6d..9273415 100755
--- a/tests/pluseq10.test
+++ b/tests/pluseq10.test
@@ -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
@@ -21,11 +21,11 @@
 
 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
+
+:
diff --git a/tests/pluseq2.test b/tests/pluseq2.test
index 28f9848..f9db345 100755
--- a/tests/pluseq2.test
+++ b/tests/pluseq2.test
@@ -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
@@ -18,7 +19,11 @@
 
 . ./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
+
+:
diff --git a/tests/pluseq3.test b/tests/pluseq3.test
index 64ddd69..755002c 100755
--- a/tests/pluseq3.test
+++ b/tests/pluseq3.test
@@ -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
@@ -18,7 +19,11 @@
 
 . ./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 'address@hidden@data_DATA = 
zarrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr \\$' 
Makefile.in
@@ -51,4 +50,4 @@ grep 'address@hidden@ doz$' Makefile.in
 
 grep 'address@hidden@data_DATA = dog$' Makefile.in
 
-Exit 0
+:
diff --git a/tests/pluseq4.test b/tests/pluseq4.test
index febc33b..744b489 100755
--- a/tests/pluseq4.test
+++ b/tests/pluseq4.test
@@ -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
@@ -18,15 +18,19 @@
 
 . ./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
+
+:
diff --git a/tests/pluseq5.test b/tests/pluseq5.test
index 5efe34e..9f7199a 100755
--- a/tests/pluseq5.test
+++ b/tests/pluseq5.test
@@ -21,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
@@ -57,3 +59,5 @@ AUTOMAKE_fails
 grep AM_CPPFLAGS stderr && Exit 1
 # !CHECK should still be mentioned.
 grep ':.*!CHECK$' stderr
+
+:
diff --git a/tests/pluseq6.test b/tests/pluseq6.test
index bb546cf..af05239 100755
--- a/tests/pluseq6.test
+++ b/tests/pluseq6.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_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
+
+:
diff --git a/tests/pluseq7.test b/tests/pluseq7.test
index f74e62c..0716462 100755
--- a/tests/pluseq7.test
+++ b/tests/pluseq7.test
@@ -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
+
+:
diff --git a/tests/pluseq8.test b/tests/pluseq8.test
index a39059a..901f8b6 100755
--- a/tests/pluseq8.test
+++ b/tests/pluseq8.test
@@ -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
+
+:
diff --git a/tests/pluseq9.test b/tests/pluseq9.test
index b7d6643..042b45d 100755
--- a/tests/pluseq9.test
+++ b/tests/pluseq9.test
@@ -20,11 +20,11 @@
 
 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 'cannot apply.*+=' stderr
 grep ':   !COND1 and !COND3$' stderr
 # Make sure there is exactly one missing condition.
 test `grep ':  ' stderr | wc -l` = 1
+
+:
-- 
1.6.5


reply via email to

[Prev in Thread] Current Thread [Next in Thread]