about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-11-15T11·23+0100
committerEelco Dolstra <edolstra@gmail.com>2017-11-15T11·23+0100
commit27131866c929d2fc7690bc7f177375df9af8e213 (patch)
tree34ac67612355fa24491517e03c5da80fefdcebee /tests
parent2f5789c5d6e779ae246659b2974560f14e24ac31 (diff)
Doh
Diffstat (limited to 'tests')
-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