aboutsummaryrefslogtreecommitdiff
path: root/runtests
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-02-11 18:43:18 -0800
committerMichael Forney <mforney@mforney.org>2019-02-12 01:55:14 -0800
commiteddc4693e49f70cd214b7645cb9fce54a89fbb6c (patch)
treefa1b640f49cde25e323aa0629aed64c064da930e /runtests
Initial import
Diffstat (limited to 'runtests')
-rwxr-xr-xruntests20
1 files changed, 20 insertions, 0 deletions
diff --git a/runtests b/runtests
new file mode 100755
index 0000000..6865d0e
--- /dev/null
+++ b/runtests
@@ -0,0 +1,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