changeset 12303:6dcb7b4b0713

test-xalloc-die.sh: fix a portability bug * tests/test-xalloc-die.sh: Do not invoke via ./test-xalloc-die. Instead, set PATH to start with "." and invoke via "test-xalloc-die". Otherwise, argv[0] (as often seen in diagnostics) would be too system-dependent, sometimes with, and sometimes without the leading "./".
author Jim Meyering <meyering@redhat.com>
date Tue, 17 Nov 2009 08:42:58 +0100
parents 3b1b1edbbf68
children 0c16d46a6fff
files ChangeLog tests/test-xalloc-die.sh
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-11-17  Jim Meyering  <meyering@redhat.com>
 
+	test-xalloc-die.sh: fix a portability bug
+	* tests/test-xalloc-die.sh: Do not invoke via ./test-xalloc-die.
+	Instead, set PATH to start with "." and invoke via "test-xalloc-die".
+	Otherwise, argv[0] (as often seen in diagnostics) would be too
+	system-dependent, sometimes with, and sometimes without the leading "./".
+
 	version-etc-fsf: relax license to LGPLv3+
 	* modules/version-etc-fsf (License): Relax license.
 
--- a/tests/test-xalloc-die.sh
+++ b/tests/test-xalloc-die.sh
@@ -13,7 +13,9 @@
 fi
 
 tmpfiles="t-xalloc-die.tmp"
-./test-xalloc-die${EXEEXT} 2> t-xalloc-die.tmp
+PATH="$PATH:."
+export PATH
+test-xalloc-die${EXEEXT} 2> t-xalloc-die.tmp
 case $? in
   1) ;;
   *) (exit 1); exit 1 ;;