[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] tests: avoid false failures on OpenBSD 5.7
From: |
Pádraig Brady |
Subject: |
[PATCH] tests: avoid false failures on OpenBSD 5.7 |
Date: |
Thu, 2 Jul 2015 13:58:31 +0100 |
* tests/du/threshold.sh: Homogenize getopt error messages.
* tests/misc/numfmt.pl: Likewise.
* tests/mv/i-3.sh: Skip on *BSD not just FreeBSD.
---
tests/du/threshold.sh | 6 ++++--
tests/misc/numfmt.pl | 3 ++-
tests/mv/i-3.sh | 2 +-
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/tests/du/threshold.sh b/tests/du/threshold.sh
index 4ce4498..a4e488a 100755
--- a/tests/du/threshold.sh
+++ b/tests/du/threshold.sh
@@ -102,9 +102,11 @@ du --threshold= a > out 2>&1 && fail=1
compare exp out || fail=1
# Exercise a bad argument: no argument.
-du --threshold > out 2>&1 && fail=1
+du --threshold > out.tmp 2>&1 && fail=1
+sed 's/argument.*/argument/; s/option.*requires/option requires/' \
+ < out.tmp > out || framework_failure_
cat <<EOF > exp
-du: option '--threshold' requires an argument
+du: option requires an argument
Try 'du --help' for more information.
EOF
compare exp out || fail=1
diff --git a/tests/misc/numfmt.pl b/tests/misc/numfmt.pl
index fcda1ce..0e4dc79 100755
--- a/tests/misc/numfmt.pl
+++ b/tests/misc/numfmt.pl
@@ -582,8 +582,9 @@ my @Tests =
# Invalid parameters
['help-1', '--foobar',
- {ERR=>"$prog: unrecognized option '--foobar'\n" .
+ {ERR=>"$prog: unrecognized option\n" .
"Try '$prog --help' for more information.\n"},
+ {ERR_SUBST=>"s/option.*/option/; s/unknown/unrecognized/"},
{EXIT=>1}],
## Format string - check error detection
diff --git a/tests/mv/i-3.sh b/tests/mv/i-3.sh
index 77d4a44..5dba1fe 100755
--- a/tests/mv/i-3.sh
+++ b/tests/mv/i-3.sh
@@ -23,7 +23,7 @@ require_controlling_input_terminal_
skip_if_root_
trap '' TTIN # Ignore SIGTTIN
-test "$(uname -s)" = FreeBSD && skip_ "known spurious failure on FreeBSD"
+uname -s | grep 'BSD$' && skip_ 'known spurious failure on *BSD'
touch f g h i || framework_failure_
chmod 0 g i || framework_failure_
--
2.4.1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] tests: avoid false failures on OpenBSD 5.7,
Pádraig Brady <=