On 10/04/2022 21:59, Bruno Haible wrote:
On Cygwin 2.9.0 (x86_64) there are 35 failures:

FAIL: tests/misc/env
FAIL: tests/misc/nice-fail
FAIL: tests/misc/timeout-parameters

These are due to `env .` being treated as command not found,
rather than cannot invoke. I saw reference that windows
createprocess may strip trailing '.', so I'm guessing './' may be ok here.
Attached uses ./ in this context in these tests.

cheers,
Pádraig
From 843a131aed3c4407183ad8234a1a1219870da521 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <p...@draigbrady.com>
Date: Tue, 12 Apr 2022 12:31:01 +0100
Subject: [PATCH] tests: cygwin: avoid using bare '.' which may be stripped

* tests/misc/env.sh: Use './' rather than a bare '.' parameter
so that cygwin doesn't strip the parameter, and thus returns
126 (cannot invoke), rather than 127 (command not found).
* tests/misc/nice-fail.sh: Likewise.
* tests/misc/stdbuf.sh: Likewise.
* tests/misc/timeout-parameters.sh: Likewise.
---
 tests/misc/env.sh                | 2 +-
 tests/misc/nice-fail.sh          | 2 +-
 tests/misc/stdbuf.sh             | 2 +-
 tests/misc/timeout-parameters.sh | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/misc/env.sh b/tests/misc/env.sh
index 3e10899d5..2d8508f78 100755
--- a/tests/misc/env.sh
+++ b/tests/misc/env.sh
@@ -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 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..af36c64c7 100755
--- a/tests/misc/nice-fail.sh
+++ b/tests/misc/nice-fail.sh
@@ -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 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..d645886b0 100755
--- a/tests/misc/stdbuf.sh
+++ b/tests/misc/stdbuf.sh
@@ -52,7 +52,7 @@ returns_ 125 stdbuf -o$SIZE_OFLOW true || fail=1 # size too large
 returns_ 125 stdbuf -iL true || fail=1 # line buffering stdin disallowed
 returns_ 125 stdbuf true || fail=1 # a buffering mode must be specified
 stdbuf -i0 -o0 -e0 true || fail=1 #check all files
-returns_ 126 stdbuf -o1 . || fail=1 # invalid command
+returns_ 126 stdbuf -o1 ./ || fail=1 # invalid command
 returns_ 127 stdbuf -o1 no_such || fail=1 # no such command
 
 # Terminate any background processes
diff --git a/tests/misc/timeout-parameters.sh b/tests/misc/timeout-parameters.sh
index fc9c8392f..6ef1a2a23 100755
--- a/tests/misc/timeout-parameters.sh
+++ b/tests/misc/timeout-parameters.sh
@@ -42,7 +42,7 @@ timeout 9.999999999 sleep 0 || fail=1
 returns_ 125 timeout --signal=invalid 1 sleep 0 || fail=1
 
 # invalid command
-returns_ 126 timeout 10 . || fail=1
+returns_ 126 timeout 10 ./ || fail=1
 
 # no such command
 returns_ 127 timeout 10 no_such || fail=1
-- 
2.26.2

Reply via email to