]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Testsuite: ensure verbose printing of captured stderr.
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 11 Jun 2010 19:22:40 +0000 (21:22 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 12 Jun 2010 11:01:14 +0000 (13:01 +0200)
* tests/acloca18.test: Print captured stderr before either failing
or grepping it.  Be sure to send captured stderr to stderr, not to
stdout.
* tests/ansi3b.test: Likewise.
* tests/cond39.test: Likewise.
* tests/configure.test: Likewise.
* tests/missing3.test: Likewise.
* tests/missing6.test: Likewise.
* tests/output-order.test: Likewise.
* tests/pr300-ltlib.test: Likewise.
* tests/python6.test: Likewise.
* tests/python7.test: Likewise.
* tests/python8.test: Likewise.
* tests/python9.test: Likewise.
* tests/subobj.test: Likewise.
* tests/vars3.test: Likewise.
* tests/missing4.test: Likewise, and fix a call to grep not to use
the `-c' flag.
* tests/ansi3.test: Likewise, and rely on the `configure.in' stub
created by `./defs', rather than writing one from scratch.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
17 files changed:
ChangeLog
tests/acloca18.test
tests/ansi3.test
tests/ansi3b.test
tests/cond39.test
tests/configure.test
tests/missing3.test
tests/missing4.test
tests/missing6.test
tests/output-order.test
tests/pr300-ltlib.test
tests/python6.test
tests/python7.test
tests/python8.test
tests/python9.test
tests/subobj.test
tests/vars3.test

index 6f6ca10a7a9d182b2dfb7267bc8c53033ba395b2..b571cf295b632fdb7573087006163c6e7e8d3e86 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,27 @@
 2010-06-12  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
+       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
+       stdout.
+       * tests/ansi3b.test: Likewise.
+       * tests/cond39.test: Likewise.
+       * tests/configure.test: Likewise.
+       * tests/missing3.test: Likewise.
+       * tests/missing6.test: Likewise.
+       * tests/output-order.test: Likewise.
+       * tests/pr300-ltlib.test: Likewise.
+       * tests/python6.test: Likewise.
+       * tests/python7.test: Likewise.
+       * tests/python8.test: Likewise.
+       * tests/python9.test: Likewise.
+       * tests/subobj.test: Likewise.
+       * tests/vars3.test: Likewise.
+       * tests/missing4.test: Likewise, and fix a call to grep not to use
+       the `-c' flag.
+       * tests/ansi3.test: Likewise, and rely on the `configure.in' stub
+       created by `./defs', rather than writing one from scratch.
+
        Enable `errexit' shell flag in various tests.
        * tests/backsl.test: Enable the `errexit' shell flag, and
        related changes.
index 276e5ba7bc8bc108e59b5375c2b1fc010a75fc8a..c38fac485ecb61964b89b67c1f23657c99b6146d 100755 (executable)
@@ -106,9 +106,13 @@ AC_DEFUN([AM_MACRO1], [echo macro1d >> foo])
 AC_DEFUN([AM_MACRO2], [echo macro2d >> foo])
 EOF
 rm -f foo
-$ACLOCAL --diff=diff >output 2>stderr
-cat stderr
-cat output
-grep '#serial 456' output
+$ACLOCAL --diff=diff >stdout 2>stderr || {
+  cat stderr >&2
+  cat stdout
+  Exit 1
+}
+cat stderr >&2
+cat stdout
+grep '#serial 456' stdout
 test ! -f 4/m1.m4
 grep 'installing.*4/m1.m4' stderr
index 2bbcaf76ef3aacf89ab47fd0249b8c216431b170..e1e0c4297b4564e97cce89462a5be642a25ddb58 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998, 1999, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1998, 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
@@ -22,12 +23,10 @@ required=gcc
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT(hello.c)
-AM_INIT_AUTOMAKE(hello,0.23)
+cat >> configure.in << 'END'
 AC_PROG_CC
 AM_C_PROTOTYPES
-AC_OUTPUT(Makefile)
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -53,8 +52,8 @@ export CFLAGS
 # Linux boxes (Red Hat 5.1 in particular).
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -a 2>stderr
-cat stderr
+$AUTOMAKE -a 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'Makefile.am:1:.*ansi2knr\.c' stderr
 CC='gcc' ./configure
 ANSI2KNR=./ansi2knr U=_ $MAKE -e
index 8f254adb2e8e3e0203f40bf280a064f2658b5af5..ad222ffe26b6cc467c5c9a5005d5ea5aa04106c2 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998, 1999, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1998, 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
@@ -52,8 +53,8 @@ export CFLAGS
 # Linux boxes (Red Hat 5.1 in particular).
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -a 2>stderr
-cat stderr
+$AUTOMAKE -a 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'configure.in:2:.*ansi2knr\.1' stderr
 CC='gcc' ./configure
 ANSI2KNR=./ansi2knr U=_ $MAKE -e
index 79eaa707760110edb242617b444d318d557edacb..8d96595badfecca1e0cffec19c6089a8c78a34b3 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2008  Free Software Foundation, Inc.
+# Copyright (C) 2008, 2010 Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -82,8 +82,8 @@ $AUTOCONF
 $AUTOMAKE --add-missing
 
 ./configure COND=true
-$MAKE 2>stderr
-cat stderr
+$MAKE 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'overriding commands' stderr && Exit 1
 $MAKE sure-exist
 ./prog1 && Exit 1
@@ -97,8 +97,8 @@ $MAKE sure-exist
 $MAKE distclean
 
 ./configure COND=false
-$MAKE 2>stderr
-cat stderr
+$MAKE 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'overriding commands' stderr && Exit 1
 ./prog1
 ./sub/prog2
@@ -107,3 +107,5 @@ $MAKE sure-not-exist
 $MAKE
 ./prog1
 ./sub/prog2
+
+:
index f7ee977cc41dbe80c7b439686586701efc948096..838da68aa6b0ee354e52a3a5918231543ff6957c 100755 (executable)
@@ -48,7 +48,7 @@ $ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; }
 cat stderr >&2
 grep 'configure.ac.*configure.in.*both present' stderr
 
-$ACLOCAL -Wno-error 2>stderr
+$ACLOCAL -Wno-error 2>stderr || { cat stderr >&2; Exit 1; }
 cat stderr >&2
 grep 'configure.ac.*configure.in.*both present' stderr
 grep 'proceeding.*configure.ac' stderr
index d3a7823351339f04725aea797a17308b9088c492..54044f561ef39470dc601be8e4db108072ceb302 100755 (executable)
@@ -43,7 +43,7 @@ grep . stderr && Exit 1
 cat stderr >&2
 grep WARNING stderr
 
-./missing --run ./missing --version 2>stderr
+./missing --run ./missing --version 2>stderr || { cat stderr >&2; Exit 1; }
 cat stderr >&2
 grep . stderr && Exit 1
 ./missing --run ./missing --grep 2>stderr && { cat stderr >&2; Exit 1; }
index 10158287bb2e29c7435b37df50547c580453e506..13a4c224ebd1f3a224a7849ada56f629f2aef788 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2006, 2007, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2006, 2007, 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
@@ -36,13 +36,13 @@ cmp aclocal.m4 aclocal.tmp && Exit 1
 
 mv aclocal.tmp aclocal.m4
 
-$MAKE 2>stderr
-cat stderr
+$MAKE 2>stderr || { cat cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'You have another version of autoconf' stderr
-grep -c 'aclocal.m4:.*this file was generated for' stderr
+grep 'aclocal.m4:.*this file was generated for' stderr
 
-$MAKE 2>stderr
-cat stderr
+$MAKE 2>stderr || { cat cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'You have another version of autoconf' stderr && Exit 1
 grep 'aclocal.m4:.*this file was generated for' stderr && Exit 1
 
index 914546b667fa08f1b4f100ed0cc34462fbf64d13..3994b8507b9345c5f00a7c6b4cdeae18452d6667 100755 (executable)
@@ -31,7 +31,7 @@ rm -f configure.in
 touch Makefile.am
 
 $ACLOCAL
-$AUTOCONF 2>stderr
+$AUTOCONF 2>stderr || { cat stderr >&2; Exit 1; }
 cat stderr >&2
 grep 'You have another version of autoconf' stderr
 grep 'aclocal.m4:.*this file was generated for' stderr
@@ -44,8 +44,8 @@ cmp configure.ac configure.tmp && Exit 1
 
 mv configure.tmp configure.ac
 
-$MAKE 2>stderr
-cat stderr
+$MAKE 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'You have another version of autoconf' stderr
 grep 'aclocal.m4:.*this file was generated for autoconf 9999a' stderr
 
index 856baa2689b1ed040734c41f5242c0037e33676d..cb9ffff937b288e50447f21b945962adac81ec90 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2008  Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -43,7 +43,7 @@ END
 $ACLOCAL
 $AUTOCONF
 rm -f missing install-sh
-$AUTOMAKE --add-missing --copy 2>stderr
+$AUTOMAKE --add-missing --copy 2>stderr || { cat stderr >&2; Exit 1; }
 cat stderr >&2
 
 for i in 1 2 3 4 5 6; do
index 01814a9b5b6313003dbdb736a56a5091f9e249ad..c6f9a5ed9cb9c3e6b87c96029858c12e4b88da13 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 2002, 2007, 2008, 2009  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2007, 2008, 2009, 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
@@ -58,7 +59,7 @@ grep 'libb.la .*-rpath .*lib/subdir' stdout
 test -f subdir/liba.la
 test -f subdir/libb.la
 
-$MAKE install 2>stderr
+$MAKE install 2>stderr || { cat stderr >&2; Exit 1; }
 cat stderr >&2
 grep 'remember.*--finish' stderr && Exit 1
 
index eb4fb4d3e7a0ba978949fafeb2474934d4f05f5a..86dcfbba729d5adb7067374e36e366ee3d036254 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
@@ -34,6 +34,8 @@ $AUTOCONF
 $AUTOMAKE --add-missing
 
 # Simulate no Python
-./configure PYTHON=: 2>stderr
-cat stderr
+./configure PYTHON=: 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'GREP ME:' stderr
+
+:
index 62c1a1bb5238dfd7b65313481ccc931f749349ac..27b2e7966d214f19d614e245dbf3e4ee480e5d2e 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
@@ -34,6 +34,8 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-./configure 2>stderr
-cat stderr
+./configure 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'GREP ME:' stderr
+
+:
index a50af228521b202dad0074f81b7431e3bcdfe72b..51d02ad9b7f1d30080b4b3d3b838c0142cfbba78 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
@@ -32,6 +32,8 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-./configure 2>stderr
-cat stderr
+./configure 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'GREP ME' stderr
+
+:
index 9b23deb3fdf07c42239dd7ddcf7b9a5b38db9f46..6a91e9fee9663b132bf2fba84aaf4f97f008c611 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
@@ -33,6 +33,8 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-./configure 2>stderr
-cat stderr
+./configure 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'GREP ME' stderr
+
+:
index df297f49e9b5f70653acea0b62dd5547279d76ee..64edd0ed4dc4443a8b2c56ca049a437d3e091073 100755 (executable)
@@ -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
@@ -32,8 +33,8 @@ wish_SOURCES = generic/a.c generic/b.c
 END
 
 $ACLOCAL
-$AUTOMAKE --add-missing 2>stderr
-cat stderr
+$AUTOMAKE --add-missing 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
 # Make sure compile is installed, and that Automake says so.
 grep 'install.*compile' stderr
 test -f compile
@@ -43,3 +44,5 @@ grep '[^/]a\.\$(OBJEXT)' Makefile.in && Exit 1
 
 # Opportunistically test for a different bug.
 grep '^generic/b.\$(OBJEXT):.*dirstamp' Makefile.in
+
+:
index 3d10a902d4ef23eebb8a13046885a3b93a612cbf..6b738ab98fe92c9966d313c76e34d81e758c3e51 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
@@ -38,8 +38,9 @@ EOF
 
 $ACLOCAL
 # Make sure this warning is print in the `portability' category.
-$AUTOMAKE --warnings=no-error,none,portability 2>stderr
-cat stderr
+$AUTOMAKE --warnings=no-error,none,portability 2>stderr \
+  || { cat stderr >&2; Exit 1; }
+cat stderr >&2
 
 # Lines number are printed in error message.
 # Use them to make sure errors are diagnosed against the right lines.