From 1c7b143a798a41e549cd1aceb532dfd08ab5e0e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?=
Date: Tue, 12 Apr 2022 12:31:01 +0100
Subject: [PATCH] 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.
---
tests/misc/env.sh | 4 ++--
tests/misc/nice-fail.sh | 4 ++--
tests/misc/stdbuf.sh | 4 ++--
tests/misc/timeout-parameters.sh | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/tests/misc/env.sh b/tests/misc/env.sh
index 3e10899d5..5a63f347c 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 3303662d1..5fdd9c315 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 e07ad02d7..6a21592a7 100755
--- a/tests/misc/stdbuf.sh
+++ b/tests/misc/stdbuf.sh
@@ -17,7 +17,7 @@
# along with this program. If not, see