At Sunday 08 August 2010, Ralf Wildenhues wrote: > * Stefano Lattarini wrote on Sun, Jun 27, 2010 at 04:48:03PM CEST: > > Another testsuite-tweaking patch. This time, the changes should > > be small and simple. > > > > Minor improvements for tests `acloca*.test'. > > This is not ok. Being forced to rescan this patch some time after having written it, I must admit that the noise-to-improvement ratio is way too high. So OK, let's drop most of this patch. However, I'd like to retain a couple of changes more than the ones blessed by you here.
WDYT about the trimmed-down attached patch? Regards, Stefano -*-*-*- Tweak and/or extend some `acloca*.test' tests. * tests/aclocal8.test: Ensure verbose printing of captured output. * tests/aclocal.test: Likewise. Also, add trailing `:' command. * tests/acloca19.test: Likewise. * tests/aclocal5.test: Add trailing `:' command, and prefer `$me' over hard-coded test name. * tests/aclocal6.test: Likewise. * tests/aclocal18.test: Add trailing `:' command, and make some grepping slighty stricter. * tests/acloca14.test: Likewise. Also, prefer `diff' over `cmp', and add some "cosmetic" blank lines.
From d0dd88f36a8ccc9b3c7b799b0e95b55c98fee40d Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Wed, 11 Aug 2010 01:21:29 +0200 Subject: [PATCH] Tweak and/or extend some `acloca*.test' tests. * tests/aclocal8.test: Ensure verbose printing of captured output. * tests/aclocal.test: Likewise. Also, add trailing `:' command. * tests/acloca19.test: Likewise. * tests/aclocal5.test: Add trailing `:' command, and prefer `$me' over hard-coded test name. * tests/aclocal6.test: Likewise. * tests/aclocal18.test: Add trailing `:' command, and make some grepping slighty stricter. * tests/acloca14.test: Likewise. Also, prefer `diff' over `cmp', and add some "cosmetic" blank lines. --- ChangeLog | 16 ++++++++++++++++ tests/acloca14.test | 16 ++++++++++++---- tests/acloca18.test | 6 ++++-- tests/acloca19.test | 4 +++- tests/aclocal.test | 8 +++++--- tests/aclocal5.test | 4 +++- tests/aclocal6.test | 8 +++++--- tests/aclocal8.test | 4 ++-- 8 files changed, 50 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index e39a5b8..5453722 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2010-08-10 Stefano Lattarini <stefano.lattar...@gmail.com> + + Tweak and/or extend some `acloca*.test' tests. + * tests/aclocal8.test: Ensure verbose printing of captured + output. + * tests/aclocal.test: Likewise. Also, add trailing `:' + command. + * tests/acloca19.test: Likewise. + * tests/aclocal5.test: Add trailing `:' command, and prefer + `$me' over hard-coded test name. + * tests/aclocal6.test: Likewise. + * tests/aclocal18.test: Add trailing `:' command, and make + some grepping slighty stricter. + * tests/acloca14.test: Likewise. Also, prefer `diff' over + `cmp', and add some "cosmetic" blank lines. + 2010-08-09 Stefano Lattarini <stefano.lattar...@gmail.com> Tweak and extend tests `pr[!0-9]*.test'. diff --git a/tests/acloca14.test b/tests/acloca14.test index a4e86d7..1bdf7c7 100755 --- a/tests/acloca14.test +++ b/tests/acloca14.test @@ -29,6 +29,7 @@ END echo 'm4_include([a.m4])' > acinclude.m4 echo 'm4_include([b.m4])' > a.m4 + cat >b.m4 <<EOF m4_include([c.m4]) AC_DEFUN([AM_PROG_LIBTOOL], @@ -38,6 +39,7 @@ AC_REQUIRE([SOMETHING_ELSE])dnl AC_DEFUN([SOMETHING]) EOF + echo 'm4_include([d.m4])' > c.m4 echo 'AC_DEFUN([SOMETHING_ELSE])' >d.m4 @@ -88,26 +90,32 @@ $sleep cat >>c.m4 <<\EOF AC_DEFUN([FOO], [ANOTHER_MACRO]) EOF + $MAKE + # Because c.m4 has changed, aclocal.m4 must have been rebuilt. test `ls -1t aclocal.m4 stamp | sed 1q` = aclocal.m4 # However, since FOO is not used, f.m4 should not be included # and the contents of aclocal.m4 should remain the same -cmp aclocal.m4 stamp - +diff aclocal.m4 stamp # If FOO where to be used, that would be another story, of course. cat >>configure.in <<EOF FOO EOF + cp aclocal.m4 stamp $sleep + $MAKE -grep 'defs/f.m4' aclocal.m4 + +$FGREP defs/f.m4 aclocal.m4 $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 +grep 'a\.m4:1: .*b\.m4.*does not exist' stderr + +: diff --git a/tests/acloca18.test b/tests/acloca18.test index c38fac4..9826892 100755 --- a/tests/acloca18.test +++ b/tests/acloca18.test @@ -88,7 +88,7 @@ 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 +grep 'macro.*AM_MACRO2.*not found' stderr ACLOCAL_TESTSUITE_FLAGS='-I 4 -I 1' rm -f foo @@ -115,4 +115,6 @@ cat stderr >&2 cat stdout grep '#serial 456' stdout test ! -f 4/m1.m4 -grep 'installing.*4/m1.m4' stderr +grep 'installing.*4/m1\.m4' stderr + +: diff --git a/tests/acloca19.test b/tests/acloca19.test index accad81..a198d9a 100755 --- a/tests/acloca19.test +++ b/tests/acloca19.test @@ -41,9 +41,11 @@ END $ACLOCAL $AUTOCONF -./configure >stdout +./configure >stdout || { cat stdout; Exit 1; } cat stdout grep GREPME stdout grep 'aconfig\.ac' aclocal.m4 && Exit 1 grep 'bconfig\.ac' aclocal.m4 && Exit 1 grep with-grepme configure + +: diff --git a/tests/aclocal.test b/tests/aclocal.test index d3437d2..da80d08 100755 --- a/tests/aclocal.test +++ b/tests/aclocal.test @@ -27,18 +27,20 @@ test -f fred $ACLOCAL --output 2>stderr && { cat stderr >&2; Exit 1; } cat stderr >&2 grep 'option.*--output.*an argument' stderr -grep help stderr +grep '[Tt]ry.*--help.*for more information' stderr $ACLOCAL --unknown-option 2>stderr && { cat stderr >&2; Exit 1; } cat stderr >&2 grep 'unrecognized.*--unknown-option' stderr -grep help stderr +grep '[Tt]ry.*--help.*for more information' stderr $ACLOCAL --ver 2>stderr && { cat stderr >&2; Exit 1; } cat stderr >&2 grep 'unrecognized.*--ver' stderr -grep help stderr +grep '[Tt]ry.*--help.*for more information' stderr $ACLOCAL --versi test "`$ACLOCAL --print-ac-dir`" = "$testaclocaldir" + +: diff --git a/tests/aclocal5.test b/tests/aclocal5.test index 5cd8231..b206587 100755 --- a/tests/aclocal5.test +++ b/tests/aclocal5.test @@ -60,7 +60,7 @@ grep GREPME sub/Makefile # Make sure configure dependencies are distributed. $MAKE distdir -test -f aclocal5-1.0/m4/moredefs.m4 +test -f $me-1.0/m4/moredefs.m4 # Change the definition of AM_TEST to check that its new definition is # used. Check that AC_DEFUN_ONCE is caught. @@ -68,3 +68,5 @@ echo 'AC_DEFUN_ONCE([AM_TEST], [AC_SUBST(__$1__)])' > m4/moredefs.m4 $MAKE grep 'm4/moredefs\.m4' aclocal.m4 grep '__GREPME__' configure + +: diff --git a/tests/aclocal6.test b/tests/aclocal6.test index 266d64b..ea6bac3 100755 --- a/tests/aclocal6.test +++ b/tests/aclocal6.test @@ -75,9 +75,9 @@ grep METOO sub/Makefile # Make sure configure dependencies are distributed. $MAKE distdir -test -f aclocal6-1.0/m4/moredefs.m4 -test -f aclocal6-1.0/m4/somedefs.m4 -test -f aclocal6-1.0/acinclude.m4 +test -f $me-1.0/m4/moredefs.m4 +test -f $me-1.0/m4/somedefs.m4 +test -f $me-1.0/acinclude.m4 # Make sure maintainer-clean works in VPATH builds. # (This is unrelated to the rest of this test.) @@ -89,3 +89,5 @@ $MAKE maintainer-clean test ! -d ../autom4te.cache test ! -f Makefile test ! -f sub/Makefile + +: diff --git a/tests/aclocal8.test b/tests/aclocal8.test index ac10aff..d935f4f 100755 --- a/tests/aclocal8.test +++ b/tests/aclocal8.test @@ -34,9 +34,9 @@ EOF echo 'AC_DEFUN([MACRO1],)' >m4/macro1.m4 echo 'AC_DEFUN([MACRO2], [AC_REQUIRE([AM_UNUSED_MACRO])])' >m4/macro2.m4 -$ACLOCAL -I m4 >output 2>&1 -cat output +$ACLOCAL -I m4 >output 2>&1 || { cat output; Exit 1; } test 0 = `wc -l <output` grep macro1.m4 aclocal.m4 grep macro2.m4 aclocal.m4 && Exit 1 + : -- 1.7.1