]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
tests: Add WVPASSSH function to wvtest.sh
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 15 Dec 2014 14:13:25 +0000 (15:13 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 15 Dec 2014 14:16:46 +0000 (15:16 +0100)
tests/wvtest.sh

index 71fac2ba1b9c9982f26c0db09ac2094a87c466c4..0a1dc3c32fc89e3748bf3b0bf9293ac1c3cfa9d2 100644 (file)
@@ -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()
 {