summaryrefslogtreecommitdiff
path: root/test.sh
blob: cd8d80d4fd8fbf7ef84a24038ff841bfa3419beb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env bash
set -euo pipefail
cabal build
prog="$(cabal exec -- sh -c 'echo "$PATH" | cut -d: -f1')/lisp"
ok=1
for f in tests/*.lisp; do
	outf="$(sed 's/\.lisp$/.out/' <<<"$f")"
	echo "- $f"
	if [[ ! -f $outf ]]; then
		echo "WARNING: $outf not found"
	else
		diff -u <("$prog" "$f") "$outf" || ok=0
	fi
done
if [[ $ok -eq 1 ]]; then
	echo "All OK"
else
	echo "Some tests failed!"
	exit 1
fi