for f in tests/*test do sed = $f | sed -n 'N s/\n/:/ /2> *stderr/{ N N s/[^\n]*\n// s/\n/:/ /cat stderr/!p }' | sed "s|^|$f:|" done
found another couple of missed verbose printing of captured output, one more with s/stderr/stdout/. For maint. Cheers, Ralf 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. diff --git a/tests/acloca14.test b/tests/acloca14.test index 8ddbb1a..a4e86d7 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 22feb23..276e5ba 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 6b87a9d..d3437d2 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 3568189..70d13f2 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 d4d7110..e9ccf62 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 07ef779..d3a7823 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 b63a0d1..914546b 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