[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[FYI] {maint} tests: fix automatic re-execution of tests with Zsh
From: |
Stefano Lattarini |
Subject: |
[FYI] {maint} tests: fix automatic re-execution of tests with Zsh |
Date: |
Sat, 23 Jun 2012 13:56:54 +0200 |
* defs: Use '$argv0' instead of '$0'. With Zsh not started right
away in Bourne-compatibility mode, the latter will be the path not
of the test script itself, but of the file it's currently sourcing
-- i.e., in our case, './defs'. This would cause the automatic
re-execution code to execute './defs' (basically a no-op) rather
than re-run the test correctly.
Signed-off-by: Stefano Lattarini <address@hidden>
---
defs | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/defs b/defs
index a47a541..217665e 100644
--- a/defs
+++ b/defs
@@ -32,8 +32,8 @@ case ${AM_TESTS_REEXEC-yes} in
;;
*)
# Ensure we can find ourselves.
- if test ! -f "$0"; then
- echo "$0: unable to find myself" >&2
+ if test ! -f "$argv0"; then
+ echo "$argv0: unable to find myself" >&2
exit 99
fi
AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
@@ -46,10 +46,10 @@ case ${AM_TESTS_REEXEC-yes} in
*x*) opts=-x;;
*) opts=;;
esac
- echo exec $AM_TEST_RUNNER_SHELL $opts "$0" "$*"
- exec $AM_TEST_RUNNER_SHELL $opts "$0" ${1+"$@"}
+ echo exec $AM_TEST_RUNNER_SHELL $opts "$argv0" "$*"
+ exec $AM_TEST_RUNNER_SHELL $opts "$argv0" ${1+"$@"}
# This should be dead code, unless some strange error happened.
- echo "$0: failed to re-execute with $AM_TEST_RUNNER_SHELL" >&2
+ echo "$argv0: failed to re-execute with $AM_TEST_RUNNER_SHELL" >&2
exit 99
;;
esac
--
1.7.9.5
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [FYI] {maint} tests: fix automatic re-execution of tests with Zsh,
Stefano Lattarini <=