Hello automakers. The attached patch is a prerequisite for the pending patch of mine "tests: avoid extra test generation (for `instspc' tests)" (reference: http://lists.gnu.org/archive/html/automake-patches/2011-02/msg00044.html) and for another patch I'm writing that will extend the coverage offered by some `depcomp*.test' tests.
I've applied the patch to maint, merged into master, and pushed. Regards, Stefano
From 3b64c7d208952e94c4b6a317cf34e5e650e77fe6 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Sun, 17 Apr 2011 17:58:45 +0200 Subject: [PATCH] test defs: allow overriding of `$me' * tests/defs.in ($me): Allow overriding by the including test script. Add some explicative comments. --- ChangeLog | 6 ++++++ tests/defs.in | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index a126dc2..bdb49db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2011-04-17 Stefano Lattarini <stefano.lattar...@gmail.com> + test defs: allow overriding of `$me' + * tests/defs.in ($me): Allow overriding by the including test + script. Add some explicative comments. + +2011-04-17 Stefano Lattarini <stefano.lattar...@gmail.com> + depcomp tests: don't reject slower dependency extractors * tests/depcomp8b.test: Add the `--enable-dependency-tracking' option to `configure' invocations, so that slower dependency diff --git a/tests/defs.in b/tests/defs.in index cf07a4e..38bb4e5 100644 --- a/tests/defs.in +++ b/tests/defs.in @@ -64,7 +64,12 @@ test -f "$srcdir/defs.in" || { exit 1 } -me=`echo "$0" | sed -e 's,.*[\\/],,;s/\.test$//'` +# The name of the current test (without the `.test' suffix). +# Test scripts can override it if they need to (but this should +# be done carefully, and *before* including ./defs). +if test -z "$me"; then + me=`echo "$0" | sed -e 's,.*[\\/],,;s/\.test$//'` +fi # This might be used in testcases checking distribution-related features. # Test scripts are free to override this if they need to. -- 1.7.2.3
diff --git a/ChangeLog b/ChangeLog index 21acbc1..7e97a4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2011-04-17 Stefano Lattarini <stefano.lattar...@gmail.com> + test defs: allow overriding of `$me' + * tests/defs.in ($me): Allow overriding by the including test + script. Add some explicative comments. + +2011-04-17 Stefano Lattarini <stefano.lattar...@gmail.com> + coverage: more tests on the parallel-tests driver * tests/parallel-tests-interrupt.test: New test. * tests/parallel-tests-reset-term.test: Likewise. diff --git a/tests/defs b/tests/defs index f67491a..ae05b82 100644 --- a/tests/defs +++ b/tests/defs @@ -32,12 +32,15 @@ test -f ./defs-static || { # Source the shell sanitization and variables' definitions. . ./defs-static || exit 99 -# The name of the current test (without the `.test' suffix.) -# Guard against failure to spawn sed (seen on MSYS), or empty $argv0. -me=`echo "$argv0" | sed -e 's,.*[\\/],,;s/\.test$//'` \ - && test -n "$me" \ - || { echo "$argv0: failed to define \$me" >&2; exit 99; } - +# The name of the current test (without the `.test' suffix). +# Test scripts can override it if they need to (but this should +# be done carefully, and *before* including ./defs). +if test -z "$me"; then + # Guard against failure to spawn sed (seen on MSYS), or empty $argv0. + me=`echo "$argv0" | sed -e 's,.*[\\/],,;s/\.test$//'` \ + && test -n "$me" \ + || { echo "$argv0: failed to define \$me" >&2; exit 99; } +fi ## ---------------------------------------- ## ## Sanity checks and environment cleanup. ##