summaryrefslogtreecommitdiff
path: root/test/solver.sh
blob: d819c70746446385205ae381a2c8285e6596aa9b (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
#!/bin/sh

APK_TEST=../src/apk_test

fail=0
for test in *.test; do
	bn=$(basename $test .test)
	$APK_TEST $(cat $test) &> $bn.got
	if ! cmp $bn.expect $bn.got 2> /dev/null; then
		fail=$((fail+1))
		echo "FAIL: $test"
		diff -ru $bn.expect $bn.got
	else
		echo "OK: $test"
	fi
done

if [ "$fail" != "0" ]; then
	echo "FAIL: $fail failed test cases"
fi

exit $fail