about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/common.sh.in11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/common.sh.in b/tests/common.sh.in
index 04d605e34438..ca6df25362dc 100644
--- a/tests/common.sh.in
+++ b/tests/common.sh.in
@@ -90,4 +90,15 @@ fail() {
     exit 1
 }
 
+expect() {
+    local expected res
+    expected="$1"
+    shift
+    set +e
+    "$@"
+    res="$?"
+    set -e
+    [[ $res -eq $expected ]]
+}
+
 set -x