From 5d8e32854c1d89e337bc606d423634a667f9b0ff Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 10 Jun 2015 18:25:12 +0100 Subject: Test suite: Move most of mustfail into t-expect-fail --- tests/lib | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'tests/lib') diff --git a/tests/lib b/tests/lib index 332bef2..c91020b 100644 --- a/tests/lib +++ b/tests/lib @@ -59,10 +59,17 @@ t-expect-fail () { set +o pipefail LC_MESSAGES=C "$@" 2>&1 | tee $tmp/t.output - local gotstatus=${PIPESTATUS[0]} + local ps="${PIPESTATUS[*]}" set -o pipefail - test $gotstatus != 0 - $grepper -e "$mpat" $tmp/t.output ||false + + case $ps in + "0 0") fail "command unexpectedly succeeded (instead of: $mpat)" ;; + *" 0") ;; + *) fail "tee failed" ;; + esac + + $grepper -e "$mpat" $tmp/t.output || + fail "error message not found" } t-reporefs () { -- cgit v1.2.3