test defs: allow overriding of `$me'
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 17 Apr 2011 15:58:45 +0000 (17:58 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 17 Apr 2011 16:08:02 +0000 (18:08 +0200)
* tests/defs.in ($me): Allow overriding by the including test
script.  Add some explicative comments.

ChangeLog
tests/defs.in

index a126dc2..bdb49db 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2011-04-17  Stefano Lattarini  <stefano.lattarini@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.lattarini@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
index cf07a4e..38bb4e5 100644 (file)
@@ -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.