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.
#! /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
# 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
#! /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
# 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
#! /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
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'
#! /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
$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
#! /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
AC_SUBST(module)])
END
-$ACLOCAL > output 2>&1 || Exit 1
+$ACLOCAL > output 2>&1 || { cat output; Exit 1; }
test -z "`cat output`"
#! /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
./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
#! /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
$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
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
:
#! /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
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`
:
#! /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
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`
:
#! /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
$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
#! /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
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
#! /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
$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`
#! /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
# 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
#! /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
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
#! /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
$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
./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
#! /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
$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
#! /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
$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
#! /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
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`"
#! /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
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