1 | #!/bin/sh |
---|
2 | # runtests.sh |
---|
3 | |
---|
4 | set -e |
---|
5 | TEST_DIR=`pwd` |
---|
6 | export DYLD_LIBRARY_PATH=${TEST_DIR}/.. |
---|
7 | export LD_LIBRARY_PATH=${TEST_DIR}/.. |
---|
8 | |
---|
9 | CHICKEN=../chicken |
---|
10 | |
---|
11 | if test "$MSYSTEM" == "MINGW32"; then |
---|
12 | CHICKEN="..\\chicken" |
---|
13 | fi |
---|
14 | |
---|
15 | compile="../csc -compiler $CHICKEN -v -I.. -L.. -include-path .. -o a.out" |
---|
16 | compile_s="../csc -s -compiler $CHICKEN -v -I.. -L.. -include-path .." |
---|
17 | interpret="../csi -n -include-path .." |
---|
18 | |
---|
19 | echo "======================================== compiler tests ..." |
---|
20 | $compile compiler-tests.scm && ./a.out |
---|
21 | |
---|
22 | echo "======================================== compiler tests (2) ..." |
---|
23 | $compile compiler-tests.scm -lambda-lift && ./a.out |
---|
24 | |
---|
25 | echo "======================================== runtime tests ..." |
---|
26 | $interpret -s apply-test.scm |
---|
27 | $compile test-gc-hooks.scm && ./a.out |
---|
28 | |
---|
29 | echo "======================================== library tests ..." |
---|
30 | $interpret -s library-tests.scm |
---|
31 | |
---|
32 | echo "======================================== syntax tests ..." |
---|
33 | $interpret -s syntax-tests.scm |
---|
34 | |
---|
35 | echo "======================================== syntax tests (compiled) ..." |
---|
36 | $compile syntax-tests.scm && ./a.out |
---|
37 | |
---|
38 | echo "======================================== syntax tests (2, compiled) ..." |
---|
39 | $compile syntax-tests-2.scm && ./a.out |
---|
40 | |
---|
41 | #echo "======================================== meta-syntax tests ..." |
---|
42 | #$interpret -bnq meta-syntax-test.scm -e '(import foo)' -e '(bar 1 2)' |
---|
43 | #$compile_s -s meta-syntax-test.scm -j foo |
---|
44 | #$compile_s -s foo.import.scm |
---|
45 | #$interpret -bnq -e '(require-library meta-syntax-test)' -e '(import foo)' -e '(bar 1 2)' |
---|
46 | |
---|
47 | echo "======================================== import library tests ..." |
---|
48 | rm -f foo.import.* |
---|
49 | $compile import-library-test1.scm -emit-import-library foo |
---|
50 | $interpret -s import-library-test2.scm |
---|
51 | $compile_s -s foo.import.scm -o foo.import.so |
---|
52 | $interpret -s import-library-test2.scm |
---|
53 | $compile import-library-test2.scm && ./a.out |
---|
54 | |
---|
55 | echo "======================================== syntax tests (matchable) ..." |
---|
56 | $interpret matchable.scm -s match-test.scm |
---|
57 | |
---|
58 | echo "======================================== syntax tests (loopy-loop) ..." |
---|
59 | $interpret -s loopy-test.scm |
---|
60 | |
---|
61 | echo "======================================== syntax tests (r5rs_pitfalls) ..." |
---|
62 | $interpret -i -s r5rs_pitfalls.scm |
---|
63 | |
---|
64 | echo "======================================== module tests ..." |
---|
65 | $interpret -include-path .. -s module-tests.scm |
---|
66 | |
---|
67 | echo "======================================== module tests (compiled) ..." |
---|
68 | $compile module-tests-compiled.scm && ./a.out |
---|
69 | |
---|
70 | echo "======================================== module tests (chained) ..." |
---|
71 | rm -f m*.import.* test-chained-modules.so |
---|
72 | $interpret -bnq test-chained-modules.scm |
---|
73 | $compile_s test-chained-modules.scm -j m3 |
---|
74 | $compile_s m3.import.scm |
---|
75 | $interpret -bn test-chained-modules.so |
---|
76 | $interpret -bn test-chained-modules.so -e '(import m3) (s3)' |
---|
77 | |
---|
78 | echo "======================================== module tests (ec) ..." |
---|
79 | rm -f ec.so ec.import.* |
---|
80 | $interpret -bqn ec.scm ec-tests.scm |
---|
81 | $compile_s ec.scm -emit-import-library ec -o ec.so |
---|
82 | $compile_s ec.import.scm -o ec.import.so |
---|
83 | $interpret -bnq ec.so ec-tests.scm |
---|
84 | # $compile ec-tests.scm && ./a.out # takes ages to compile |
---|
85 | |
---|
86 | echo "======================================== hash-table tests ..." |
---|
87 | $interpret -s hash-table-tests.scm |
---|
88 | |
---|
89 | echo "======================================== lolevel tests ..." |
---|
90 | $interpret -s lolevel-tests.scm |
---|
91 | |
---|
92 | echo "======================================== port tests ..." |
---|
93 | $interpret -s port-tests.scm |
---|
94 | |
---|
95 | echo "======================================== fixnum tests ..." |
---|
96 | $compile fixnum-tests.scm && ./a.out |
---|
97 | |
---|
98 | echo "======================================== srfi-18 tests ..." |
---|
99 | $interpret -s srfi-18-tests.scm |
---|
100 | |
---|
101 | echo "======================================== path tests ..." |
---|
102 | $compile path-tests.scm && ./a.out |
---|
103 | |
---|
104 | echo "======================================== regular expression tests ..." |
---|
105 | $interpret -bnq test-irregex.scm |
---|
106 | |
---|
107 | echo "======================================== r4rstest ..." |
---|
108 | $interpret -e '(set! ##sys#procedure->string (constantly "#<procedure>"))' \ |
---|
109 | -i -s r4rstest.scm >r4rstest.log |
---|
110 | diff -bu r4rstest.out r4rstest.log || true |
---|
111 | |
---|
112 | echo "======================================== finalizer tests ..." |
---|
113 | $interpret -s test-finalizers.scm |
---|
114 | |
---|
115 | echo "======================================== finalizer tests (2) ..." |
---|
116 | $compile test-finalizers-2.scm && ./a.out |
---|
117 | |
---|
118 | echo "======================================== locative stress test ..." |
---|
119 | $compile locative-stress-test.scm && ./a.out |
---|
120 | |
---|
121 | echo "======================================== embedding (1) ..." |
---|
122 | $compile embedded1.c && ./a.out |
---|
123 | |
---|
124 | echo "======================================== embedding (2) ..." |
---|
125 | $compile -e embedded2.scm && ./a.out |
---|
126 | |
---|
127 | echo "======================================== benchmarks ..." |
---|
128 | cd ../benchmarks |
---|
129 | for x in `ls *.scm`; do |
---|
130 | case $x in |
---|
131 | "cscbench.scm");; |
---|
132 | "plists.scm");; |
---|
133 | *) |
---|
134 | echo $x |
---|
135 | ../csc $x -compiler $CHICKEN -C -I.. -L.. -O2 -d0 |
---|
136 | ./`basename $x .scm`;; |
---|
137 | esac |
---|
138 | done |
---|
139 | cd ${TEST_DIR} |
---|
140 | |
---|
141 | echo "======================================== done." |
---|