On 2026-04-19 01:18, Bruno Haible wrote:
But the test still fails on:
   - Solaris 10
   - Solaris 11 OpenIndiana

Thanks, although I didn't reproduce the problem on my department's Solaris 10 sparc host (still in production use! we are nearly running a museum...) I think I see the problem. I installed the attached to try to fix it.

From dd4ee3fc416e6553a6d47cdab9dea14311eaa222 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Sun, 19 Apr 2026 08:28:59 -0700
Subject: [PATCH] tests: use $GREP not grep

Problem reported by Bruno Haible in:
https://bugs.gnu.org/80855#64
* tests/pipe-output, tests/zdiff, tests/zgrep-binary:
* tests/zgrep-context:
Use $GREP, not grep.  Also, be consistent about unsetting
GREP_OPTIONS, for portability to GNU grep 3.5 and earlier
when the user unwisely set GREP_OPTIONS.
---
 tests/pipe-output   | 5 ++++-
 tests/zdiff         | 5 ++++-
 tests/zgrep-binary  | 7 ++++---
 tests/zgrep-context | 1 +
 4 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/tests/pipe-output b/tests/pipe-output
index 2693a91..7b1241c 100755
--- a/tests/pipe-output
+++ b/tests/pipe-output
@@ -19,6 +19,9 @@
 
 . "${srcdir=.}/init.sh"; path_prepend_ ..
 
+: ${GREP=grep}
+unset GREP_OPTIONS
+
 sleep 0.01 && sleep_amount=0.01 || sleep_amount=1
 
 echo a >a && echo b >b || framework_failure_
@@ -54,7 +57,7 @@ for trap_pipe in trap :; do
     case $cmd in
       zcmp*) get_underlying_status 'cmp - b <a' $minfail;;
       zdiff*) get_underlying_status 'diff - b <a' $minfail;;
-      zgrep*) get_underlying_status 'grep a <a' $minfail;;
+      zgrep*) get_underlying_status '$GREP a <a' $minfail;;
       *) underlying_status=$cat_status minfail=1;;
     esac
     test $minfail -lt $cmd_status && test $cmd_status -lt 128 && cmd_status=1
diff --git a/tests/zdiff b/tests/zdiff
index dc5f357..433e47a 100755
--- a/tests/zdiff
+++ b/tests/zdiff
@@ -20,6 +20,9 @@
 
 . "${srcdir=.}/init.sh"; path_prepend_ ..
 
+: ${GREP=grep}
+unset GREP_OPTIONS
+
 echo a > a || framework_failure_
 echo b > b || framework_failure_
 
@@ -37,7 +40,7 @@ gzip a b || fail=1
 returns_ 1 zdiff a.gz b.gz > out 2> err || fail=1
 
 compare exp out || fail=1
-grep -v '^+' err && fail=1
+$GREP -v '^+' err && fail=1
 
 rm -f out
 # expect success, for equal files
diff --git a/tests/zgrep-binary b/tests/zgrep-binary
index 28032b1..4d6dc48 100755
--- a/tests/zgrep-binary
+++ b/tests/zgrep-binary
@@ -20,11 +20,12 @@
 
 . "${srcdir=.}/init.sh"; path_prepend_ ..
 
-fail=0
-
+: ${GREP=grep}
 unset GREP_OPTIONS
 
+fail=0
+
 printf 'foo\0\n' >f || framework_failure_
-LC_ALL=C zgrep foo f >out 2>err && grep '(standard input)' out err && fail=1
+LC_ALL=C zgrep foo f >out 2>err && $GREP '(standard input)' out err && fail=1
 
 Exit $fail
diff --git a/tests/zgrep-context b/tests/zgrep-context
index e2e47db..3daa70e 100755
--- a/tests/zgrep-context
+++ b/tests/zgrep-context
@@ -35,6 +35,7 @@ gzip < in > in.gz || framework_failure_
 seq 2 32 > exp || framework_failure_
 
 : ${GREP=grep}
+unset GREP_OPTIONS
 $GREP -15 17 - < in > out && compare exp out || {
   echo >&2 "$0: $GREP does not support context options; skipping this test"
   exit 77
-- 
2.51.0

Reply via email to