]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: avoid failure due to bug in FreeBSD 8.1's /bin/sh
authorJim Meyering <meyering@redhat.com>
Sat, 6 Nov 2010 14:20:06 +0000 (15:20 +0100)
committerJim Meyering <meyering@redhat.com>
Sat, 6 Nov 2010 14:24:53 +0000 (15:24 +0100)
* tests/init.sh: Arrange not to accept FreeBSD 8.1's /bin/sh, since
it fails this test: /bin/sh -c 'f(){ local s=$IFS; test -n "$s"; }; f'
* tests/init.cfg (sanitize_path_): Stop-gap measure to work around
a bug in FreeBSD 8.1's /bin/sh.  We'll un-do this change once all
300+ tests use init.sh.

tests/init.cfg
tests/init.sh

index 1048cf39d4dc77036d71a19cfaeab1a962603a79..778625702cb25082fc4924f7874eff901a13b260 100644 (file)
@@ -12,7 +12,9 @@ stderr_fileno_=9
 # Avoid the problem by rewriting PATH to exclude unsearchable directories.
 sanitize_path_()
 {
-  local saved_IFS=$IFS
+  # FIXME: remove double quotes around $IFS when all tests use init.sh.
+  # They constitute a work-around for a bug in FreeBSD 8.1's /bin/sh.
+  local saved_IFS="$IFS"
     IFS=:
     set -- $PATH
   IFS=$saved_IFS
index a57de77a2f1ac47a83be0adf463b8c05b9221790..0193cbec1f9e7995fb3b606e8a19d1703d187f4e 100644 (file)
@@ -93,6 +93,9 @@ else
 fi
 
 # We require $(...) support unconditionally.
+# We also require "local" support.  The local-vs-IFS test is required to
+# eliminate FreeBSD 8.1's /bin/sh, which would otherwise pass these tests
+# and provoke opaque test failures in coreutils.
 # We require a few additional shell features only when $EXEEXT is nonempty,
 # in order to support automatic $EXEEXT emulation:
 # - hyphen-containing alias names
@@ -115,6 +118,7 @@ fi
 #  ? - not ok
 gl_shell_test_script_='
 test $(echo y) = y || exit 1
+gl_local_test_(){ local s=$IFS; test -n "$s"; }; gl_local_test_ || exit 1
 score_=10
 if test "$VERBOSE" = yes; then
   test -n "$( (exec 3>&1; set -x; P=1 true 2>&3) 2> /dev/null)" && score_=9