aboutsummaryrefslogtreecommitdiff
path: root/tests/check.sh
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-03-23 16:14:51 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2023-03-23 16:14:51 +0200
commit5b038666c3e911ffeb78a4d656044e5bd076705b (patch)
tree9b09b4f27c39ef6a0139a5eb9bfa5e98a250086c /tests/check.sh
parent70615379062cdd2e016f5095dfafd23a6dca148c (diff)
downloadek-5b038666c3e911ffeb78a4d656044e5bd076705b.tar.gz
ek-5b038666c3e911ffeb78a4d656044e5bd076705b.zip
integrate parser work
Diffstat (limited to 'tests/check.sh')
-rwxr-xr-xtests/check.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/check.sh b/tests/check.sh
new file mode 100755
index 0000000..397d36d
--- /dev/null
+++ b/tests/check.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+echo > check.log
+
+tests=0
+passed=0
+failed=0
+
+for file in $(echo check/*.cu)
+do
+ testcase=$(echo "$file" | cut -f 1 -d '.')
+ expected="$testcase".ok
+ args=$(test -e "$testcase".args && cat "$testcase".args)
+
+ echo -n testing "$testcase"...
+
+ cmd="./cu "$args" "$file" -o check/run && ./check/run"
+
+ tests=$((tests + 1))
+ if test "$output" = "$expected"
+ then
+ passed=$((passed + 1))
+ echo ok
+ else
+ failed=$((failed + 1))
+ echo fail
+ fi;
+
+ if test -n "$VERBOSE"
+ then
+ echo "$cmd"
+ fi
+done
+
+echo
+echo tests "$tests", passed "$passed", failed "$failed"