On Saturday 02 October 2010, Ralf Wildenhues wrote: > Hi Stefano, > > * Stefano Lattarini wrote on Sat, Oct 02, 2010 at 07:35:34PM CEST: > > The attached patch fixes the breakage. OK for maint? > > > > (Still, I don't like having to tweak test script with needless > > quoting to avoid spurious maintcheck failures. Oh well.) > > Well, here's an idea then that doesn't break: > make check AUTOMAKE=override ACLOCAL=override > > Use $AUTOMAKE and $ACLOCAL but for the purpose of the tests, remove > flags from it that you don't want; i.e., something like this: > > AUTOMAKE=`echo $AUTOMAKE | sed 's, -Werror,,g'` > > Patch to that end preapproved if you agree. Yes I do. Honoring user overrides is always better.
Attached is what I pushed. Regards, Stefano
From 0498520e65fed0222d07190b6124d3de92c6044c Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Sat, 2 Oct 2010 19:33:44 +0200 Subject: [PATCH] Improve tests `help*.test' (also fixes maintcheck failures). * tests/help.test: To run automake, use `$AUTOMAKE' with all `-W' flags stripped away rather than hard-coded `automake-$APIVERSION', to better honour user-overrides. Similarly for aclocal. * tests/help2.test: Likewise. * tests/help3.test: Likewise. * tests/help4.test: Likewise. From a suggestion by Ralf Wildenhues. --- ChangeLog | 11 +++++++++++ tests/help.test | 16 ++++++++++------ tests/help2.test | 12 ++++++++---- tests/help3.test | 16 ++++++++++------ tests/help4.test | 12 ++++++++---- 5 files changed, 47 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2090381..06a6e47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2010-10-03 Stefano Lattarini <stefano.lattar...@gmail.com> + Ralf Wildenhues <ralf.wildenh...@gmx.de> + + Improve tests `help*.test' (also fixes maintcheck failures). + * tests/help.test: To run automake, use `$AUTOMAKE' with all `-W' + flags stripped away rather than hard-coded `automake-$APIVERSION', + to better honour user-overrides. Similarly for aclocal. + * tests/help2.test: Likewise. + * tests/help3.test: Likewise. + * tests/help4.test: Likewise. + 2010-10-03 Ralf Wildenhues <ralf.wildenh...@gmx.de> Document and fix expansion of variables before rules. diff --git a/tests/help.test b/tests/help.test index ddeb92f..012e1d7 100755 --- a/tests/help.test +++ b/tests/help.test @@ -25,18 +25,22 @@ set -e mkdir emptydir cd emptydir -aclocal-$APIVERSION --version -aclocal-$APIVERSION --help -automake-$APIVERSION --version -automake-$APIVERSION --help +# Honour user overrides for $ACLOCAL and $AUTOMAKE. +ACLOCAL=`echo " $ACLOCAL " | sed 's/ -W[^ ]* / /g'` +AUTOMAKE=`echo " $AUTOMAKE " | sed 's/ -W[^ ]* / /g'` + +$ACLOCAL --version +$ACLOCAL --help +$AUTOMAKE --version +$AUTOMAKE --help # Sanity checks: aclocal and automake cannot work without configure.ac # or configure.in. -aclocal-$APIVERSION 2>stderr && { cat stderr >&2; Exit 1; } +$ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; } cat stderr >&2 $FGREP configure.ac stderr $FGREP configure.in stderr -automake-$APIVERSION 2>stderr && { cat stderr >&2; Exit 1; } +$AUTOMAKE 2>stderr && { cat stderr >&2; Exit 1; } cat stderr >&2 $FGREP configure.ac stderr $FGREP configure.in stderr diff --git a/tests/help2.test b/tests/help2.test index 014f187..7a05aca 100755 --- a/tests/help2.test +++ b/tests/help2.test @@ -24,16 +24,20 @@ set -e mkdir cleandir cd cleandir +# Honour user overrides for $ACLOCAL and $AUTOMAKE. +ACLOCAL=`echo " $ACLOCAL " | sed 's/ -W[^ ]* / /g'` +AUTOMAKE=`echo " $AUTOMAKE " | sed 's/ -W[^ ]* / /g'` + echo '[' > configure.in -automake-$APIVERSION --version -automake-$APIVERSION --help +$AUTOMAKE --version +$AUTOMAKE --help # aclocal and automake cannot work without configure.ac or configure.in -aclocal-$APIVERSION 2>stderr && { cat stderr >&2; Exit 1; } +$ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; } cat stderr >&2 $FGREP configure.in stderr -automake-$APIVERSION 2>stderr && { cat stderr >&2; Exit 1; } +$AUTOMAKE 2>stderr && { cat stderr >&2; Exit 1; } cat stderr >&2 $FGREP configure.in stderr diff --git a/tests/help3.test b/tests/help3.test index 8e9e76f..04a07d6 100755 --- a/tests/help3.test +++ b/tests/help3.test @@ -24,6 +24,10 @@ set -e mkdir cleandir cd cleandir +# Honour user overrides for $ACLOCAL and $AUTOMAKE. +ACLOCAL=`echo " $ACLOCAL " | sed 's/ -W[^ ]* / /g'` +AUTOMAKE=`echo " $AUTOMAKE " | sed 's/ -W[^ ]* / /g'` + cat > configure.in <<END AC_INIT([$me], [1.0]) AC_CONFIG_AUX_DIR([.]) dnl prevent automake from looking into '..' @@ -36,22 +40,22 @@ cat > Makefile.am <<END pkgdata_DATA = END -aclocal-$APIVERSION --force --help --output=foo.m4 +$ACLOCAL --force --help --output=foo.m4 test ! -r foo.m4 -aclocal-$APIVERSION --output=foo.m4 --version --force +$ACLOCAL --output=foo.m4 --version --force test ! -r foo.m4 # Sanity check. -aclocal-$APIVERSION --output=foo.m4 --force +$ACLOCAL --output=foo.m4 --force test -f foo.m4 mv -f foo.m4 aclocal.m4 # automake will need aclocal.m4 -automake-$APIVERSION --add-missing --help --copy +$AUTOMAKE --add-missing --help --copy test ! -r install-sh -automake-$APIVERSION --copy --version --add-mising +$AUTOMAKE --copy --version --add-mising test ! -r install-sh # Sanity check. -automake-$APIVERSION --add-missing --copy +$AUTOMAKE --add-missing --copy test -f install-sh : diff --git a/tests/help4.test b/tests/help4.test index 906e508..117a073 100755 --- a/tests/help4.test +++ b/tests/help4.test @@ -25,25 +25,29 @@ set -e mkdir emptydir cd emptydir +# Honour user overrides for $ACLOCAL and $AUTOMAKE. +ACLOCAL=`echo " $ACLOCAL " | sed 's/ -W[^ ]* / /g'` +AUTOMAKE=`echo " $AUTOMAKE " | sed 's/ -W[^ ]* / /g'` + escape_dots () { sed 's/\./\\./g'; } # avoid issues with `\' in backquotes apiversion_rx=`echo "$APIVERSION" | escape_dots` -aclocal-$APIVERSION --version --help >stdout || { cat stdout; Exit 1; } +$ACLOCAL --version --help >stdout || { cat stdout; Exit 1; } cat stdout grep "^aclocal.*$apiversion_rx" stdout grep "^Usage" stdout && Exit 1 -aclocal-$APIVERSION --help --version >stdout || { cat stdout; Exit 1; } +$ACLOCAL --help --version >stdout || { cat stdout; Exit 1; } cat stdout grep "^Usage" stdout grep "^aclocal.*$apiversion_rx" stdout && Exit 1 -automake-$APIVERSION --version --help >stdout || { cat stdout; Exit 1; } +$AUTOMAKE --version --help >stdout || { cat stdout; Exit 1; } cat stdout grep "^automake.*$apiversion_rx" stdout grep "^Usage" stdout && Exit 1 -automake-$APIVERSION --help --version >stdout || { cat stdout; Exit 1; } +$AUTOMAKE --help --version >stdout || { cat stdout; Exit 1; } cat stdout grep "^Usage" stdout grep "^automake.*$apiversion_rx" stdout && Exit 1 -- 1.7.1