aboutsummaryrefslogtreecommitdiff
path: root/runtests
blob: 6865d0ed21e02ea5c7930f3ce7e8e06029f956de (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 ${CC:=./cc} -emit-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