summaryrefslogtreecommitdiff
path: root/tests/init.sh
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2010-12-18 20:02:45 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2010-12-18 20:03:21 -0800
commit5947491895ae37c68941a36960face05269b5a85 (patch)
treeb05a77ab77b4e8b843f249fe89a5dc6a9c3beb6e /tests/init.sh
parent0eaa993ae64d75c7b9da62c99e9e5f617b6a248d (diff)
downloadcoreutils-5947491895ae37c68941a36960face05269b5a85.tar.xz
tests: sync init.sh from gnulib
* tests/init.sh (setup_): Initialize fail=0 before invoking mktempd_. Ensure that IFS is defined initially. (mktempd_): Remove fail=0 initialization; no longer needed.
Diffstat (limited to 'tests/init.sh')
-rw-r--r--tests/init.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/init.sh b/tests/init.sh
index 7be5e9e8a..4d89a1af6 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -324,21 +324,25 @@ setup_()
fi
initial_cwd_=$PWD
+ fail=0
pfx_=`testdir_prefix_`
test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \
|| fail_ "failed to create temporary directory in $initial_cwd_"
cd "$test_dir_"
+ # As autoconf-generated configure scripts do, ensure that IFS
+ # is defined initially, so that saving and restoring $IFS works.
+ gl_init_sh_nl_='
+'
+ IFS=" "" $gl_init_sh_nl_"
+
# This trap statement, along with a trap on 0 below, ensure that the
# temporary directory, $test_dir_, is removed upon exit as well as
# upon receipt of any of the listed signals.
for sig_ in 1 2 3 13 15; do
eval "trap 'Exit $(expr $sig_ + 128)' $sig_"
done
-
- # Set up for the "Exit $fail" at the end of many tests.
- fail=0
}
# Create a temporary directory, much like mktemp -d does.
@@ -413,8 +417,6 @@ mktempd_()
*) fail_ "invalid template: $template_ (must have a suffix of at least 4 X's)";;
esac
- fail=0
-
# First, try to use mktemp.
d=`unset TMPDIR; mktemp -d -t -p "$destdir_" "$template_" 2>/dev/null` \
|| fail=1