-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathruntests
executable file
·26 lines (26 loc) · 974 Bytes
/
runtests
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
set -e
# I like MzScheme for its diagnostics, but I’ve stopped depending on
# it because it keeps changing:
# : ${refscheme:="mzscheme -r"}
: ${refscheme="guile -s"}
# But ELK is the fastest of bigloo, guile, mzscheme, SCM, and ELK for
# this purpose:
# : ${refscheme:="elk -l"}
# you can run with urscheme=urscheme-compiler instead
: ${urscheme:="$refscheme compiler.scm"}
status='echo ERROR: FAILED'
trap '/bin/rm -f refscheme.out newcompiler.out runtest.s runtest; $status' EXIT
ulimit -s 1024 # to make the tailcall test run reasonably fast
runtest () {
prog="${1?runtest needs an argument}"
echo "running $prog"
$refscheme "$prog" > refscheme.out
$urscheme < "$prog" > runtest.s
gcc -m32 -nostdlib runtest.s -o runtest
./runtest > newcompiler.out
diff -au refscheme.out newcompiler.out
}
if [ $# -eq 0 ] ; then set test.*.scm; fi
for test in "$@"; do runtest "$test"; done
status='echo PASSED'