-
Notifications
You must be signed in to change notification settings - Fork 0
/
self_host_test.sh
executable file
·55 lines (40 loc) · 958 Bytes
/
self_host_test.sh
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
set -e
stage_count=3
log() {
echo "$@" >&2
"$@"
}
run_stage1() {
stak-compile
}
run_stage2() {
stak-interpret stage2.out
}
run_stage3() {
stak-interpret stage3.out
}
artifact_path() {
echo tmp/stage$1.$2
}
cd $(dirname $0)/..
export PATH=$(dirname $0)/../target/release:$PATH
mkdir -p tmp
brew install gauche
cargo build --release
for stage in $(seq $(expr $stage_count - 1)); do
cat prelude.scm compile.scm | run_stage$stage >stage$(expr $stage + 1).out
done
for file in bench/*/main.scm compile.scm; do
echo '>>>' $file
for stage in $(seq $stage_count); do
out_file=$(artifact_path $stage out)
cat prelude.scm $file | log run_stage$stage >$out_file
stak-decode <$out_file >${out_file%.*}.txt
done
for stage in $(seq $(expr $stage_count - 1)); do
for extension in txt out; do
log diff $(artifact_path $stage $extension) $(artifact_path $(expr $stage + 1) $extension)
done
done
done