From: Ralf Wildenhues Date: Sun, 25 Apr 2010 09:42:23 +0000 (+0200) Subject: testsuite: ensure verbose printing of captured output. X-Git-Tag: v1.11.1b~85^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76b2ca952f073428010a294f98c9d47ee97eb907;p=thirdparty%2Fautomake.git testsuite: ensure verbose printing of captured output. * tests/acloca14.test, tests/acloca18.test, tests/aclocal.test, tests/fort2.test, tests/help.test, tests/missing3.test, tests/missing6.test: Print captured stdout or stderr before grepping it. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index d8398ccbc..e6f3d4551 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-04-25 Ralf Wildenhues + + testsuite: ensure verbose printing of captured output. + * tests/acloca14.test, tests/acloca18.test, tests/aclocal.test, + tests/fort2.test, tests/help.test, tests/missing3.test, + tests/missing6.test: Print captured stdout or stderr before + grepping it. + 2010-04-20 Stefano Lattarini Make test badopt.test stricter (by enabling `set -e'). diff --git a/tests/acloca14.test b/tests/acloca14.test index 8ddbb1a81..a4e86d751 100755 --- a/tests/acloca14.test +++ b/tests/acloca14.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2004, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004, 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 @@ -109,4 +109,5 @@ $MAKE testdist2 # Make sure aclocal diagnose missing included files with correct `file:line:'. rm -f b.m4 $ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; } +cat stderr >&2 grep 'a.m4:1:.*b.m4.*does not exist' stderr diff --git a/tests/acloca18.test b/tests/acloca18.test index 22feb2305..276e5ba7b 100755 --- a/tests/acloca18.test +++ b/tests/acloca18.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2005, 2006, 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 @@ -87,6 +87,7 @@ grep macro23 foo ACLOCAL_TESTSUITE_FLAGS='-I 4 -I 1 -I 2' rm -f foo $ACLOCAL --install 2>stderr && { cat stderr >&2; Exit 1; } +cat stderr >&2 grep AM_MACRO2 stderr ACLOCAL_TESTSUITE_FLAGS='-I 4 -I 1' diff --git a/tests/aclocal.test b/tests/aclocal.test index 6b87a9dd9..d3437d26c 100755 --- a/tests/aclocal.test +++ b/tests/aclocal.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 1998, 2001, 2002, 2004, 2008 Free Software Foundation, Inc. +# Copyright (C) 1998, 2001, 2002, 2004, 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 @@ -24,14 +25,17 @@ $ACLOCAL --output=fred test -f fred $ACLOCAL --output 2>stderr && { cat stderr >&2; Exit 1; } +cat stderr >&2 grep 'option.*--output.*an argument' stderr grep help stderr $ACLOCAL --unknown-option 2>stderr && { cat stderr >&2; Exit 1; } +cat stderr >&2 grep 'unrecognized.*--unknown-option' stderr grep help stderr $ACLOCAL --ver 2>stderr && { cat stderr >&2; Exit 1; } +cat stderr >&2 grep 'unrecognized.*--ver' stderr grep help stderr diff --git a/tests/fort2.test b/tests/fort2.test index 356818936..70d13f25e 100755 --- a/tests/fort2.test +++ b/tests/fort2.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006, 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 @@ -48,6 +48,7 @@ $AUTOMAKE grep '.\$(LINK)' Makefile.in && Exit 1 grep '.\$(FCLINK)' Makefile.in grep '.\$(FCCOMPILE)' Makefile.in > stdout +cat stdout grep -v '\$(FCFLAGS_f' stdout && Exit 1 grep '.\$(FC.*\$(FCFLAGS_blabla' Makefile.in && Exit 1 # Notice the TAB: diff --git a/tests/help.test b/tests/help.test index d4d7110af..e9ccf62ce 100755 --- a/tests/help.test +++ b/tests/help.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2003, 2008 Free Software Foundation, Inc. +# Copyright (C) 2003, 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 @@ -33,6 +33,7 @@ $AUTOMAKE --help # aclocal and automake cannot work without configure.ac or configure.in $ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; } +cat stderr >&2 grep configure.ac stderr grep configure.in stderr AUTOMAKE_fails diff --git a/tests/missing3.test b/tests/missing3.test index 07ef77990..d3a782335 100755 --- a/tests/missing3.test +++ b/tests/missing3.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2004, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004, 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 @@ -23,23 +23,30 @@ set -e # b7cb8259 assumed not to exist. ./missing b7cb8259 --version 2>stderr && { cat stderr >&2; Exit 1; } +cat stderr >&2 grep . stderr && Exit 1 ./missing b7cb8259 --grep 2>stderr && { cat stderr >&2; Exit 1; } +cat stderr >&2 grep WARNING stderr ./missing --run b7cb8259 --version && Exit 1 ./missing --run b7cb8259 --grep 2>stderr && { cat stderr >&2; Exit 1; } +cat stderr >&2 grep WARNING stderr # missing itself it known to exist :) ./missing ./missing --version 2>stderr && { cat stderr >&2; Exit 1; } +cat stderr >&2 grep . stderr && Exit 1 ./missing ./missing --grep 2>stderr && { cat stderr >&2; Exit 1; } +cat stderr >&2 grep WARNING stderr ./missing --run ./missing --version 2>stderr +cat stderr >&2 grep . stderr && Exit 1 ./missing --run ./missing --grep 2>stderr && { cat stderr >&2; Exit 1; } +cat stderr >&2 grep WARNING stderr && Exit 1 grep Unknown stderr diff --git a/tests/missing6.test b/tests/missing6.test index b63a0d1af..914546b66 100755 --- a/tests/missing6.test +++ b/tests/missing6.test @@ -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 @@ -32,6 +32,7 @@ touch Makefile.am $ACLOCAL $AUTOCONF 2>stderr +cat stderr >&2 grep 'You have another version of autoconf' stderr grep 'aclocal.m4:.*this file was generated for' stderr $AUTOMAKE