From: Pádraig Brady
Date: Tue, 12 Apr 2022 11:31:01 +0000 (+0100)
Subject: tests: cygwin: handle ENOENT from execvp(".")
X-Git-Tag: v9.1~11
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f920e93ecf1b693b3729168496a9f50e194ecd0;p=thirdparty%2Fcoreutils.git
tests: cygwin: handle ENOENT from execvp(".")
* tests/misc/env.sh: Verify with another command that
execvp() doesn not return ENOENT, before testing the
exit code from the command in question.
* tests/misc/nice-fail.sh: Likewise.
* tests/misc/stdbuf.sh: Likewise.
* tests/misc/timeout-parameters.sh: Likewise.
---
diff --git a/tests/misc/env.sh b/tests/misc/env.sh
index 3e10899d58..5a63f347cd 100755
--- a/tests/misc/env.sh
+++ b/tests/misc/env.sh
@@ -18,7 +18,7 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
-print_ver_ env pwd
+print_ver_ env pwd nice
# A simple shebang program to call "echo" from symlinks like "./-u" or "./--".
echo "#!$abs_top_builddir/src/echo simple_echo" > simple_echo \
@@ -46,7 +46,7 @@ compare exp out || fail=1
returns_ 125 env --- || fail=1 # unknown option
returns_ 125 env -u || fail=1 # missing option argument
returns_ 2 env sh -c 'exit 2' || fail=1 # exit status propagation
-returns_ 126 env . || fail=1 # invalid command
+returns_ 126 nice . && { returns_ 126 env . || fail=1; } # invalid command
returns_ 127 env no_such || fail=1 # no such command
# POSIX is clear that environ may, but need not be, sorted.
diff --git a/tests/misc/nice-fail.sh b/tests/misc/nice-fail.sh
index 3303662d10..5fdd9c315f 100755
--- a/tests/misc/nice-fail.sh
+++ b/tests/misc/nice-fail.sh
@@ -18,7 +18,7 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
-print_ver_ nice
+print_ver_ nice env
# These tests verify exact status of internal failure.
@@ -26,7 +26,7 @@ returns_ 125 nice -n 1 || fail=1 # missing command
returns_ 125 nice --- || fail=1 # unknown option
returns_ 125 nice -n 1a || fail=1 # invalid adjustment
returns_ 2 nice sh -c 'exit 2' || fail=1 # exit status propagation
-returns_ 126 nice . || fail=1 # invalid command
+returns_ 126 env . && { returns_ 126 nice . || fail=1; } # invalid command
returns_ 127 nice no_such || fail=1 # no such command
Exit $fail
diff --git a/tests/misc/stdbuf.sh b/tests/misc/stdbuf.sh
index e07ad02d79..6a21592a75 100755
--- a/tests/misc/stdbuf.sh
+++ b/tests/misc/stdbuf.sh
@@ -17,7 +17,7 @@
# along with this program. If not, see