It is guaranteed that with `/bin/sh script', the shell searches in the
current directory for `script', no matter whether `.' or `pwd' is in
$PATH. However, POSIX only allows but not requires that it also search
$PATH if the script is not in `.'. FreeBSD's shell, for example, does
not search $PATH.
(I know you knew all that, but I didn't, so I'm writing that down for
myself. ;-)
I've fixed the test as shown below.
Cheers,
Ralf
2007-10-21 Ralf Wildenhues <[EMAIL PROTECTED]>
Fix `Deep Package' test failure on FreeBSD.
* tests/torture.at (Deep Package): Do not add `.' to $PATH
unnecessarily. Do not try running `/bin/sh configure' with a
configure script to be found in $PATH, if the shell does not do
this resolution. Fixes test failure on FreeBSD.
diff --git a/tests/torture.at b/tests/torture.at
index 0a835ba..4ffaafb 100644
--- a/tests/torture.at
+++ b/tests/torture.at
@@ -1160,7 +1160,7 @@ chmod a-w inner/innermost inner
AT_CHECK([./configure --help=recursive | grep " INNER "], 0, [ignore])
AT_CHECK([./configure --help=recursive | grep " INNERMOST "], 0, [ignore])
AT_CHECK([/bin/sh ./configure --help=recursive | grep " INNERMOST "], 0,
[ignore])
-AT_CHECK([PATH=.$PATH_SEPARATOR$PATH /bin/sh configure --help=recursive | grep
" INNERMOST "], 0, [ignore])
+AT_CHECK([/bin/sh configure --help=recursive | grep " INNERMOST "], 0,
[ignore])
AT_CHECK([PATH=.$PATH_SEPARATOR$PATH; export PATH; configure --help=recursive
| grep " INNERMOST "], 0, [ignore])
chmod u+w inner inner/innermost
@@ -1176,7 +1176,10 @@ chmod a-w builddir inner/innermost inner
AT_CHECK([cd builddir && ../configure --help=recursive | grep " INNER "],
0, [ignore])
AT_CHECK([cd builddir && ../configure --help=recursive | grep " INNERMOST "],
0, [ignore])
AT_CHECK([cd builddir && /bin/sh ../configure --help=recursive | grep "
INNERMOST "], 0, [ignore])
-AT_CHECK([cd builddir && PATH=`pwd`/..$PATH_SEPARATOR$PATH /bin/sh configure
--help=recursive | grep " INNERMOST "], 0, [ignore])
+# Not all shells search $PATH for scripts.
+if (cd builddir && PATH=`pwd`/..$PATH_SEPARATOR$PATH /bin/sh configure --help)
>/dev/null 2>&1; then
+ AT_CHECK([cd builddir && PATH=`pwd`/..$PATH_SEPARATOR$PATH /bin/sh configure
--help=recursive | grep " INNERMOST "], 0, [ignore])
+fi
AT_CHECK([PATH=`pwd`$PATH_SEPARATOR$PATH; export PATH; cd builddir &&
configure --help=recursive | grep " INNERMOST "], 0, [ignore])
chmod u+w builddir inner inner/innermost
AT_CHECK([cd builddir && ../configure INNERMOST=build/tsomrenni], 0, [ignore])