]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Print captured output before failing.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 5 Oct 2008 19:24:32 +0000 (21:24 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 5 Oct 2008 19:24:32 +0000 (21:24 +0200)
* tests/acloca14.test, tests/acloca17.test, tests/acloca18.test,
tests/aclocal.test, tests/acsilent.test, tests/alpha.test,
tests/check4.test, tests/color.test, tests/fn99.test,
tests/fn99subdir.test, tests/help.test, tests/init.test,
tests/lisp8.test, tests/missing3.test, tests/pr220.test,
tests/python11.test, tests/python4.test, tests/python5.test,
tests/unused.test, tests/version8.test: When Exit is called
after a command that has stdout or stderr redirected to a file
for later inspection, output the file before failing the test.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
21 files changed:
ChangeLog
tests/acloca14.test
tests/acloca17.test
tests/acloca18.test
tests/aclocal.test
tests/acsilent.test
tests/alpha.test
tests/check4.test
tests/color.test
tests/fn99.test
tests/fn99subdir.test
tests/help.test
tests/init.test
tests/lisp8.test
tests/missing3.test
tests/pr220.test
tests/python11.test
tests/python4.test
tests/python5.test
tests/unused.test
tests/version8.test

index 55614d05e40e5f99073c883b838a24ba1b30df13..04030550cc2a79f6425322e9457bcea468e5f5ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2008-10-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       Print captured output before failing.
+       * tests/acloca14.test, tests/acloca17.test, tests/acloca18.test,
+       tests/aclocal.test, tests/acsilent.test, tests/alpha.test,
+       tests/check4.test, tests/color.test, tests/fn99.test,
+       tests/fn99subdir.test, tests/help.test, tests/init.test,
+       tests/lisp8.test, tests/missing3.test, tests/pr220.test,
+       tests/python11.test, tests/python4.test, tests/python5.test,
+       tests/unused.test, tests/version8.test: When Exit is called
+       after a command that has stdout or stderr redirected to a file
+       for later inspection, output the file before failing the test.
+
        Fix some comment typos.
        * automake.in: Fix some comment typos.
        * lib/Automake/Condition.pm: Likewise.
index 4042d0ef8197e67321fefba77810f64a5440cdfb..c07afa6165c40828b054e60d10f375c1525813ef 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2008  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
@@ -108,5 +108,5 @@ $MAKE testdist2
 
 # Make sure aclocal diagnose missing included files with correct `file:line:'.
 rm -f b.m4
-$ACLOCAL 2>stderr && Exit 1
+$ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; }
 grep 'a.m4:1:.*b.m4.*does not exist' stderr
index d60a5a0c37254a1c6cb47de75d542021da9b334e..196d20b358e321c901e7979a59bae9c0145b7eb1 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2008  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,6 @@ EOF
 # FIXME: We want autom4te's 'undefined required macro' warning to be fatal,
 # but have no means to say so to aclocal.  We use WARNINGS=error instead.
 
-WARNINGS=error $ACLOCAL -I m4 2>stderr && Exit 1
-cat stderr
+WARNINGS=error $ACLOCAL -I m4 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'configure.in:4:.*UNDEFINED_MACRO' stderr
index f0bfd571a93e15c40fcf1296a01eb12607c3e99a..be827e3d1d1b21c926dcd62d81c2bf6dad0604b1 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2005, 2006  Free Software Foundation, Inc.
+# Copyright (C) 2005, 2006, 2008  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
@@ -86,7 +86,7 @@ grep macro23 foo
 
 ACLOCAL_TESTSUITE_FLAGS='-I 4 -I 1 -I 2'
 rm -f foo
-$ACLOCAL --install 2>stderr && Exit 1
+$ACLOCAL --install 2>stderr && { cat stderr >&2; Exit 1; }
 grep AM_MACRO2 stderr
 
 ACLOCAL_TESTSUITE_FLAGS='-I 4 -I 1'
index 4431779a719d3c8e9a558b6caa720fdbb54cf64c..a894d984e65e7862a1d2181337cb75c244b99927 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2004  Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2004, 2008  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,15 +23,15 @@ set -e
 $ACLOCAL --output=fred
 test -f fred
 
-$ACLOCAL --output 2>stderr && Exit 1
+$ACLOCAL --output 2>stderr && { cat stderr >&2; Exit 1; }
 grep 'option.*--output.*an argument' stderr
 grep help stderr
 
-$ACLOCAL --unknown-option 2>stderr && Exit 1
+$ACLOCAL --unknown-option 2>stderr && { cat stderr >&2; Exit 1; }
 grep 'unrecognized.*--unknown-option' stderr
 grep help stderr
 
-$ACLOCAL --ver 2>stderr && Exit 1
+$ACLOCAL --ver 2>stderr && { cat stderr >&2; Exit 1; }
 grep 'unrecognized.*--ver' stderr
 grep help stderr
 
index c1fb4cd0c21fceb762b40729576421a8dfbdf2f5..04438fd12400b55a3432a8ad70e35ac3d770c352 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 2008  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,5 +32,5 @@ module=[$1]
 AC_SUBST(module)])
 END
 
-$ACLOCAL > output 2>&1 || Exit 1
+$ACLOCAL > output 2>&1 || { cat output; Exit 1; }
 test -z "`cat output`"
index ba17d74b20a1b82179f850673c5650a06b8d8ea5..9994d9d66cfdcc1f2d998429d92f59d3dbd1a07e 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2003, 2008  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
@@ -62,8 +62,8 @@ $AUTOMAKE
 ./configure
 
 # make distdir should fail because NEWS does not mention 1.0a
-$MAKE check 2>stderr && Exit 1
-cat stderr
+$MAKE check 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'NEWS not updated' stderr
 test ! -f works
 
index fce92192cd68d1529212283cd59246f05758e425..ac367ca22310aaad1bc626e3237deaf54faa2a03 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2005, 2007  Free Software Foundation, Inc.
+# Copyright (C) 2005, 2007, 2008  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
@@ -50,7 +50,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 ./configure --prefix "`pwd`/inst"
-$MAKE check >stdout && Exit 1
+$MAKE check >stdout && { cat stdout; Exit 1; }
 cat stdout
 grep 'FAIL: fail.sh' stdout
 grep 'PASS: ok.sh' stdout && Exit 1
index 5a02e8d192205701cddae92552471cd3f3035ce1..cd668454b8006a394a2a0360d5b1d0f12b870d14 100755 (executable)
@@ -105,11 +105,11 @@ AM_COLOR_TESTS=always $MAKE -e check >stdout && { cat stdout; Exit 1; }
 cat stdout
 test_color
 
-MAKE=$MAKE expect -f expect-make >stdout || Exit 77
+MAKE=$MAKE expect -f expect-make >stdout || { cat stdout; Exit 77; }
 cat stdout
 test_color
 
-AM_COLOR_TESTS=no MAKE=$MAKE expect -f expect-make >stdout || Exit 77
+AM_COLOR_TESTS=no MAKE=$MAKE expect -f expect-make >stdout || { cat stdout; Exit 77; }
 cat stdout
 test_no_color
 :
index a23b169f9e636a05803ac55cd3c98b3caeeee916..31ee1b5110d486528b55b751dfd8703a12c0f2ba 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2008  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
@@ -47,8 +47,8 @@ do
   touch x
 done) || Exit 77
 
-$MAKE dist 2>stderr && Exit 1
-cat stderr
+$MAKE dist 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'filenames are too long' stderr
 test 2 = `grep 12345678 stderr | wc -l`
 :
index e7b16c1038af31de5b3726c6eccbc475c2f608a6..f0a7928634e24c6baeaa285f86b9f0667e107864 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2006  Free Software Foundation, Inc.
+# Copyright (C) 2006, 2008  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
@@ -73,8 +73,8 @@ do
   touch x
 done)
 
-$MAKE dist 2>stderr && Exit 1
-cat stderr
+$MAKE dist 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'filenames are too long' stderr
 test 1 = `grep 12345678 stderr | wc -l`
 :
index 82f73dd9833e4e9f815f997aefbc80d2cc77d86c..030624f770ede85a315e9637cc1cac1f801fc91d 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2008  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,7 +32,7 @@ $AUTOMAKE --version
 $AUTOMAKE --help
 
 # aclocal and automake cannot work without configure.ac or configure.in
-$ACLOCAL 2>stderr && Exit 1
+$ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; }
 grep configure.ac stderr
 grep configure.in stderr
 AUTOMAKE_fails
index 914a221c8660231bce590ffdba1c9c14e4414a1c..8eaf581e0bb9ef4f1af9c682565bc952c6cf3362 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2006  Free Software Foundation, Inc.
+# Copyright (C) 2006, 2008  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
@@ -27,7 +27,7 @@ AM_INIT_AUTOMAKE
 END
 
 # The error message should mension AC_INIT, not AC_PACKAGE_VERSION.
-($ACLOCAL && $AUTOCONF) 2>stderr && Exit 1
-cat stderr
+($ACLOCAL && $AUTOCONF) 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep AC_PACKAGE_VERSION stderr && Exit 1
 grep AC_INIT stderr
index fe6a7142cab6a8561ca7e782e19426db90cb1898..578cd9c264c2319f0ed0bf1cabbb954e6ce9d20e 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2005  Free Software Foundation, Inc.
+# Copyright (C) 2005, 2008  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
@@ -39,7 +39,7 @@ $AUTOCONF
 $AUTOMAKE --add-missing
 ./configure
 
-$MAKE -j >stdout
+$MAKE -j >stdout || { cat stdout; Exit 1; }
 
 cat stdout
 test 1 -eq `grep 'Warnings can be ignored' stdout | wc -l`
index 9d6a57478ea7c9aff65980266cc6c8cbef22bc98..c9173634eca6cb290dda339db26793830bc44d59 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2008  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,24 +22,24 @@ set -e
 
 # b7cb8259 assumed not to exist.
 
-./missing b7cb8259 --version 2>stderr && Exit 1
+./missing b7cb8259 --version 2>stderr && { cat stderr >&2; Exit 1; }
 grep . stderr && Exit 1
-./missing b7cb8259 --grep 2>stderr && Exit 1
+./missing b7cb8259 --grep 2>stderr && { cat stderr >&2; Exit 1; }
 grep WARNING stderr
 
 ./missing --run b7cb8259 --version && Exit 1
-./missing --run b7cb8259 --grep 2>stderr && Exit 1
+./missing --run b7cb8259 --grep 2>stderr && { cat stderr >&2; Exit 1; }
 grep WARNING stderr
 
 # missing itself it known to exist :)
 
-./missing ./missing --version 2>stderr && Exit 1
+./missing ./missing --version 2>stderr && { cat stderr >&2; Exit 1; }
 grep . stderr && Exit 1
-./missing ./missing --grep 2>stderr && Exit 1
+./missing ./missing --grep 2>stderr && { cat stderr >&2; Exit 1; }
 grep WARNING stderr
 
 ./missing --run ./missing --version 2>stderr
 grep . stderr && Exit 1
-./missing --run ./missing --grep 2>stderr && Exit 1
+./missing --run ./missing --grep 2>stderr && { cat stderr >&2; Exit 1; }
 grep WARNING stderr && Exit 1
 grep Unknown stderr
index 137436766081904879854f1808aef6136a94f3f1..2401e597267e578fc816e5937837b9d359c8183a 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2004  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2004, 2008  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
@@ -55,6 +55,6 @@ $AUTOMAKE -a
 
 cd build
 # configure should fail since we've done something invalid.
-../configure 2>stderr && Exit 1
-cat stderr
+../configure 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep NEVER_TRUE stderr
index fb0eeb6f2901ffaf683b60230f9809d538c21070..b95e31b3fdda776d1ed041132e4c95bd62abca7a 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004, 2006  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2006, 2008  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
@@ -35,9 +35,9 @@ EOF
 $ACLOCAL
 $AUTOCONF
 
-./configure >stdout 2>stderr && Exit 1
+./configure >stdout 2>stderr && { cat stdout; cat stderr >&2; Exit 1; }
 cat stdout
-cat stderr
+cat stderr >&2
 grep 'checking for IShouldNotExist1' stdout
 grep 'checking for IShouldNotExist2' stdout
 grep 'no suitable Python interpreter found' stderr
@@ -50,6 +50,6 @@ $AUTOCONF
 ./configure
 
 # Any user setting should be used.
-./configure PYTHON=foo >stdout && Exit 1
+./configure PYTHON=foo >stdout && { cat stdout; Exit 1; }
 cat stdout
 grep 'PYTHON = foo' stdout
index 3fad96ab6f8f423d8b2e2121a82306a578a2f99b..770bf5095d320d37a13920842948ed4acfe6fbc2 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2008  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,6 @@ $AUTOCONF
 $AUTOMAKE --add-missing
 
 # Simulate no Python
-./configure PYTHON=: 2>stderr && Exit 1
-cat stderr
+./configure PYTHON=: 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'no suitable Python interpreter found' stderr
index 6f789152f722cb53f01059275426c90ab10ef846..af79377297f977d295e3036de25f67fc7bdd88d3 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2008  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,6 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-./configure 2>stderr && Exit 1
-cat stderr
+./configure 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 grep 'no suitable Python interpreter found' stderr
index 45ca4854cc54cc71c0e0696b8616922fbae72d9e..6d1f764872df407c5fc8524b502ee78f37840fc9 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1998, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1998, 2002, 2003, 2008  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
@@ -29,5 +29,5 @@ AC_DEFUN([MACRO_1_2], echo 12)
 AC_DEFUN([MACRO_1_2_3], echo 123)
 END
 
-$ACLOCAL 2> output || Exit 1
-test -z "`cat output`"
+$ACLOCAL 2> stderr || { cat stderr >&2; Exit 1; }
+test -z "`cat stderr`"
index de61cf18e565482ba79fad4281c10128a31081f2..250ec17eedabdd330d50ea6e8b1e698d93b7c08b 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2005  Free Software Foundation, Inc.
+# Copyright (C) 2005, 2008  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,5 +20,6 @@
 
 set -e
 echo 'AM_AUTOMAKE_VERSION([1.9])' >>configure.in
-$ACLOCAL 2>stderr && Exit 0
+$ACLOCAL 2>stderr && { cat stderr >&2; Exit 0; }
+cat stderr >&2
 $FGREP 'AM_INIT_AUTOMAKE([1.9])' stderr