From 27131866c929d2fc7690bc7f177375df9af8e213 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 15 Nov 2017 12:23:31 +0100 Subject: [PATCH] Doh --- tests/common.sh.in | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/common.sh.in b/tests/common.sh.in index 04d605e34..ca6df2536 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