From e9ae7b89470793dbb6935e2f5f066b0535459f2f Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Mon, 15 Dec 2014 15:13:25 +0100 Subject: [PATCH] tests: Add WVPASSSH function to wvtest.sh --- tests/wvtest.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/wvtest.sh b/tests/wvtest.sh index 71fac2b..0a1dc3c 100644 --- a/tests/wvtest.sh +++ b/tests/wvtest.sh @@ -68,6 +68,23 @@ WVPASS() fi } +# Use WVPASSSH instead of WVPASS when the command includes pipe or +# output redirection. The whole command must be one argument - quote +# it. +WVPASSSH() +{ + TEXT="$1" + + _wvfind_caller + if bash -o pipefail -c "$@"; then + _wvcheck 0 "$TEXT" + return 0 + else + _wvcheck 1 "$TEXT" + # NOTREACHED + return 1 + fi +} WVFAIL() { -- 2.39.2