aboutsummaryrefslogtreecommitdiff
path: root/tests/check.sh
blob: 397d36d3d53d78fb038f02a38070b125e8d7f4bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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"