[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] tests/portability: avoid spurious failure with OpenBSD's /bin/sh
From: |
Jim Meyering |
Subject: |
[PATCH] tests/portability: avoid spurious failure with OpenBSD's /bin/sh |
Date: |
Wed, 08 Sep 2010 12:05:12 +0200 |
FYI, I needed this to avoid a test failure on OpenBSD 4.7.
Contrast these:
$ /bin/sh -c 'set -x; P=1 : 2> err' 2>/dev/null; cat err
+ P=1
$ bash -c 'set -x; P=1 : 2> err' 2>/dev/null; cat err
$
At first I was tempted to eliminate /bin/sh from the running by
changing init.sh's shell qualification tests to include something
like the above, but since using VERBOSE=yes and letting init.sh do
the "set -x" works just fine, I've simply removed the unnecessary
statement from this sole offending script:
>From 20985033d0f22f4e7b719fb1be6ce47768c8c575 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 8 Sep 2010 12:00:46 +0200
Subject: [PATCH] tests/portability: avoid spurious failure with OpenBSD's
/bin/sh
* tests/warn-char-classes: Don't use "set -x" here. It causes
a spurious test failure on openbsd 4.7 when using its /bin/sh,
since the command, /bin/sh -xc 'P=1 : 2> err' emits "P=1" into err.
To enable set -x, run the test with "VERBOSE=yes", e.g.,
make check -C tests TESTS=warn-char-classes VERBOSE=yes
---
tests/warn-char-classes | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/tests/warn-char-classes b/tests/warn-char-classes
index 25bf640..8cc6563 100644
--- a/tests/warn-char-classes
+++ b/tests/warn-char-classes
@@ -2,8 +2,6 @@
# Use of any --include or --exclude* option would segfault in 2.6 and 2.6.1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
-set -x
-
echo f > x || framework_failure_
echo b >> x || framework_failure_
echo h >> x || framework_failure_
--
1.7.3.rc0.174.g69763
- [PATCH] tests/portability: avoid spurious failure with OpenBSD's /bin/sh,
Jim Meyering <=