From: Stefano Lattarini Date: Sat, 2 Oct 2010 17:33:44 +0000 (+0200) Subject: Improve tests `help*.test' (also fixes maintcheck failures). X-Git-Tag: v1.12.0b~453 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0498520e65fed0222d07190b6124d3de92c6044c;p=platform%2Fupstream%2Fautomake.git 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. --- diff --git a/ChangeLog b/ChangeLog index 2090381..06a6e47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2010-10-03 Stefano Lattarini + Ralf Wildenhues + + 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 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 < Makefile.am <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