summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2018-12-23 17:22:02 -0800
committerJim Meyering <meyering@fb.com>2018-12-23 17:24:49 -0800
commit93a1e963e1590d9cb3c1e4f423a5664ee4a589cc (patch)
treeb5df858bed2d1f2afc9f44ecbd50a4e20a4a23df /tests
parent15059822384415b62f4f7de593abba7c2e05aa57 (diff)
downloaddiffutils-93a1e963e1590d9cb3c1e4f423a5664ee4a589cc.tar.gz
build: update gnulib to latest; and bootstrap and init.sh
Diffstat (limited to 'tests')
-rw-r--r--tests/init.sh25
1 files changed, 19 insertions, 6 deletions
diff --git a/tests/init.sh b/tests/init.sh
index 705a698..93d14f5 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -13,7 +13,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Using this file in a test
# =========================
@@ -62,6 +62,19 @@
ME_=`expr "./$0" : '.*/\(.*\)$'`
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+ # contains only /bin. Note that ksh looks also at the FPATH variable,
+ # so we have to set that as well for the test.
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ || PATH_SEPARATOR=';'
+ }
+fi
+
# We use a trap below for cleanup. This requires us to go through
# hoops to get the right exit status transported through the handler.
# So use 'Exit STATUS' instead of 'exit STATUS' inside of the tests.
@@ -250,7 +263,7 @@ test -n "$BASH_VERSION" && unalias -a
# That is part of the shell-selection test above. Why use aliases rather
# than functions? Because support for hyphen-containing aliases is more
# widespread than that for hyphen-containing function names.
-test -n "$EXEEXT" && shopt -s expand_aliases
+test -n "$EXEEXT" && test -n "$BASH_VERSION" && shopt -s expand_aliases
# Enable glibc's malloc-perturbing option.
# This is useful for exposing code that depends on the fact that
@@ -429,13 +442,13 @@ path_prepend_ ()
path_dir_=$1
case $path_dir_ in
'') fail_ "invalid path dir: '$1'";;
- /*) abs_path_dir_=$path_dir_;;
+ /* | ?:*) abs_path_dir_=$path_dir_;;
*) abs_path_dir_=$initial_cwd_/$path_dir_;;
esac
case $abs_path_dir_ in
- *:*) fail_ "invalid path dir: '$abs_path_dir_'";;
+ *$PATH_SEPARATOR*) fail_ "invalid path dir: '$abs_path_dir_'";;
esac
- PATH="$abs_path_dir_:$PATH"
+ PATH="$abs_path_dir_$PATH_SEPARATOR$PATH"
# Create an alias, FOO, for each FOO.exe in this directory.
create_exe_shims_ "$abs_path_dir_" \
@@ -514,7 +527,7 @@ rand_bytes_ ()
fi
n_plus_50_=`expr $n_ + 50`
- cmds_='date; date +%N; free; who -a; w; ps auxww; ps ef; netstat -n'
+ cmds_='date; date +%N; free; who -a; w; ps auxww; ps -ef'
data_=` (eval "$cmds_") 2>&1 | gzip `
# Ensure that $data_ has length at least 50+$n_