From: Stefano Lattarini Date: Thu, 8 Sep 2011 21:26:09 +0000 (+0200) Subject: tests: more granularity in variables for tools overriding X-Git-Tag: ng-0.5a~89^2~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=v1.11-1318-g3ceeef4;p=thirdparty%2Fautomake.git tests: more granularity in variables for tools overriding Among the other things, this change makes it possible to use, at the same time, an autoconf version in the automake testsuite and another one in the automake build system; even more importantly, it makes it possible to use, say, a non-GNU make implementation in the test scripts, while at the same time using GNU make to drive the execution of the automake's test suite. * tests/defs-static.in (TEX, EGREP, FGREP, SHELL, PERL, MAKE, AUTOCONF, AUTOM4TE, AUTORECONF, AUTOHEADER, AUTOUPDATE, original_AUTOMAKE, original_ACLOCAL): Allow and prefer overriding through corresponding `AM_TESTSUITE_..' variables; for example, $GREP can now be overridden by an exported `$AM_TESTSUITE_GREP' --- diff --git a/ChangeLog b/ChangeLog index 3c12c8bee..01e30aba8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2011-09-08 Stefano Lattarini + + tests: more granularity in variables for tools overriding + Among the other things, this change makes it possible to use, at + the same time, an autoconf version in the automake testsuite and + another one in the automake build system; even more importantly, it + makes it possible to use, say, a non-GNU make implementation in the + test scripts, while at the same time using GNU make to drive the + execution of the automake's test suite. + * tests/defs-static.in (TEX, EGREP, FGREP, SHELL, PERL, MAKE, + AUTOCONF, AUTOM4TE, AUTORECONF, AUTOHEADER, AUTOUPDATE, + original_AUTOMAKE, original_ACLOCAL): Allow and prefer overriding + through corresponding `AM_TESTSUITE_..' variables; for example, + $GREP can now be overridden by an exported `$AM_TESTSUITE_GREP' + 2011-09-08 Stefano Lattarini testsuite: fix `skip_row_' subroutine in tap-functions.sh diff --git a/tests/defs-static.in b/tests/defs-static.in index e461b77f6..44b80ba35 100644 --- a/tests/defs-static.in +++ b/tests/defs-static.in @@ -136,51 +136,57 @@ PATH_SEPARATOR='@PATH_SEPARATOR@' host_alias=${host_alias-'@host_alias@'}; export host_alias build_alias=${build_alias-'@build_alias@'}; export build_alias -# Make sure we override the user shell. -SHELL='@SHELL@'; export SHELL -# User can override various tools used. -test -z "$PERL" && PERL='@PERL@' -test -z "$MAKE" && MAKE=make -test -z "$AUTOCONF" && AUTOCONF="@am_AUTOCONF@" -test -z "$AUTOM4TE" && AUTOM4TE="@am_AUTOM4TE@" -test -z "$AUTORECONF" && AUTORECONF="@am_AUTORECONF@" -test -z "$AUTOHEADER" && AUTOHEADER="@am_AUTOHEADER@" -test -z "$AUTOUPDATE" && AUTOUPDATE="@am_AUTOUPDATE@" +# Make sure we override the user shell. And do not read the value of +# $SHELL from the environment (think to the non-uncommon situation where +# e.g., $SHELL=/bin/tcsh). +SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}; export SHELL + +# User can override various tools used. Prefer overriding specific for +# that automake testsuite, if they are available. +PERL=${AM_TESTUITE_PERL-${PERL-'@PERL@'}} +MAKE=${AM_TESTSUITE_MAKE-${MAKE-'make'}} +AUTOCONF=${AM_TESTSUITE_AUTOCONF-${AUTOCONF-'@am_AUTOCONF@'}} +AUTOM4TE=${AM_TESTSUITE_AUTOM4TE-${AUTOM4TE-'@am_AUTOM4TE@'}} +AUTORECONF=${AM_TESTSUITE_AUTORECONF-${AUTORECONF-'@am_AUTORECONF@'}} +AUTOHEADER=${AM_TESTSUITE_AUTOHEADER-${AUTOHEADER-'@am_AUTOHEADER@'}} +AUTOUPDATE=${AM_TESTSUITE_AUTOUPDATE-${AUTOUPDATE-'@am_AUTOUPDATE@'}} + +# Tests who want complete control over aclocal or automake command-line +# options should use $original_ACLOCAL or $original_AUTOMAKE. The +# `test -z' tests take care not to re-initialize them if defs-static +# is re-sourced, as we want defs-static to remain really idempotent. +if test -z "$original_AUTOMAKE"; then + original_AUTOMAKE=${AM_TESTSUITE_AUTOMAKE-${AUTOMAKE-"automake-$APIVERSION"}} +fi +if test -z "$original_ACLOCAL"; then + original_ACLOCAL=${AM_TESTSUITE_ACLOCAL-${ACLOCAL-"aclocal-$APIVERSION"}} +fi # Use -Werror because this also turns some Perl warnings into error. # Tests for which this is inappropriate should use -Wno-error. # Tests who want complete control over aclocal command-line options -# should use $original_ACLOCAL. -# Note: the first `test -z' conditional below is to ensure defs-static -# really remains idempotent. -if test -z "$original_ACLOCAL"; then - original_ACLOCAL=${ACLOCAL-"aclocal-$APIVERSION"} -fi -test -z "$ACLOCAL" && ACLOCAL="aclocal-$APIVERSION -Werror" +# should use $original_ACLOCAL instead. +ACLOCAL="$original_ACLOCAL -Werror" # See how Automake should be run. We put --foreign as the default # strictness to avoid having to create lots and lots of files. A test # can override this by specifying a different strictness. Use -Wall # -Werror by default. Tests for which this is inappropriate (e.g. when # testing that a warning is enabled by a specific switch) should use -# -Wnone or/and -Wno-error. Tests who want complete control over -# automake command-line options should use $original_AUTOMAKE. -# Note: the first `test -z' conditional below is to ensure defs-static -# really remains idempotent. -if test -z "$original_AUTOMAKE"; then - original_AUTOMAKE=${AUTOMAKE-"automake-$APIVERSION"} -fi -test -z "$AUTOMAKE" && AUTOMAKE="automake-$APIVERSION --foreign -Werror -Wall" +# -Wnone or/and -Wno-error. +# Tests who want complete control over automake command-line options +# should use $original_AUTOMAKE instead. +AUTOMAKE="$original_AUTOMAKE --foreign -Werror -Wall" # POSIX no longer requires 'egrep' and 'fgrep', # but some hosts lack 'grep -E' and 'grep -F'. -EGREP='@EGREP@' -FGREP='@FGREP@' +EGREP=${AM_TESTSUITE_EGREP-'@EGREP@'} +FGREP=${AM_TESTSUITE_FGREP-'@FGREP@'} # No all versions of Tex support `--version', so we use a configure # check to decide if tex is available. This decision is embodied in # this variable. -TEX='@TEX@' +TEX=${AM_TESTSUITE_TEX-'@TEX@'} # Whether $SHELL has working 'set -e' with exit trap. sh_errexit_works='@sh_errexit_works@'