[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[FYI] {testsuite-work} tests: more namespace-awareness in variables for
From: |
Stefano Lattarini |
Subject: |
[FYI] {testsuite-work} tests: more namespace-awareness in variables for tools overriding |
Date: |
Thu, 8 Sep 2011 23:35:18 +0200 |
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'
---
ChangeLog | 15 ++++++++++++
tests/defs-static.in | 62 +++++++++++++++++++++++++++----------------------
2 files changed, 49 insertions(+), 28 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3c12c8b..2e1ea90 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
2011-09-08 Stefano Lattarini <address@hidden>
+ tests: more namespace-awareness 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 <address@hidden>
+
testsuite: fix `skip_row_' subroutine in tap-functions.sh
* tests/tap-functions.sh (skip_row_): Use `seq_', not `seq', to
be portable to non-GNU systems.
diff --git a/tests/defs-static.in b/tests/defs-static.in
index e461b77..44b80ba 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@'
--
1.7.2.3
- [FYI] {testsuite-work} tests: more namespace-awareness in variables for tools overriding,
Stefano Lattarini <=