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.
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
#! /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
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'
# 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
#! /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
# 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
#!/bin/sh
-# Copyright (C) 2008 Free Software Foundation, Inc.
+# Copyright (C) 2008, 2010 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
$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
$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
$MAKE
./prog1
./sub/prog2
+
+:
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
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; }
#! /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
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
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
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
#! /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
$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
#! /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
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
#! /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
$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
+
+:
#! /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
$AUTOCONF
$AUTOMAKE --add-missing
-./configure 2>stderr
-cat stderr
+./configure 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
grep 'GREP ME:' stderr
+
+:
#! /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
$AUTOCONF
$AUTOMAKE --add-missing
-./configure 2>stderr
-cat stderr
+./configure 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
grep 'GREP ME' stderr
+
+:
#! /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
$AUTOCONF
$AUTOMAKE --add-missing
-./configure 2>stderr
-cat stderr
+./configure 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
grep 'GREP ME' stderr
+
+:
#! /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
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
# Opportunistically test for a different bug.
grep '^generic/b.\$(OBJEXT):.*dirstamp' Makefile.in
+
+:
#! /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
$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.