aboutsummaryrefslogtreecommitdiff
path: root/runtests
blob: 7c6919da8abbd35bb1834bdd217eb7dba586dee8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

if [ $# = 0 ] ; then
	set -- tests/*.c
fi

exitstatus=0
out=$(mktemp)
trap 'rm "$out"' EXIT
for test ; do
	if ${CCQBE:=./cc-qbe} -o $out $test && diff -Nu "${test%.c}.qbe" "$out" ; then
		result="PASS"
	else
		result="FAIL"
		exitstatus=1
	fi
	echo "[$result] $test" >&2
done

exit $exitstatus