summary refs log tree commit diff
path: root/t/lib.sh
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2017-03-31 16:10:43 +0200
committerDuncaen <mail@duncano.de>2017-03-31 16:10:47 +0200
commitb960d5e3cc1abd1849ef6c0019f16ab7dd77e52a (patch)
tree3215ac0466314d28619bd005908a678d4699d480 /t/lib.sh
parent08ea54953ffdac34e60b2d93b0777324413f737d (diff)
downloadmblaze-b960d5e3cc1abd1849ef6c0019f16ab7dd77e52a.tar.gz
mblaze-b960d5e3cc1abd1849ef6c0019f16ab7dd77e52a.tar.xz
mblaze-b960d5e3cc1abd1849ef6c0019f16ab7dd77e52a.zip
t: add check_test
Diffstat (limited to 't/lib.sh')
-rw-r--r--t/lib.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/lib.sh b/t/lib.sh
index 81c2dd1..567250b 100644
--- a/t/lib.sh
+++ b/t/lib.sh
@@ -14,6 +14,17 @@ check() {
 	true
 }
 
+check_test() {
+	msg=$1; op=$2; test=$3; shift 3
+	if [ "$(eval "$@" 2>/dev/null)" "$op" "$test" ]; then
+		printf 'ok - %s\n' "$msg"
+	else
+		printf 'not ok - %s\n' "$msg"
+		false
+	fi
+	true
+}
+
 check_same() {
 	msg=$1
 	shift