mescc: Tinycc support: Fix for ?-operator.
[mes.git] / build-aux / check-boot.sh
1 #! /bin/bash
2
3 # Mes --- Maxwell Equations of Software
4 # Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
5 #
6 # This file is part of Mes.
7 #
8 # Mes is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or (at
11 # your option) any later version.
12 #
13 # Mes is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with Mes.  If not, see <http://www.gnu.org/licenses/>.
20
21 set -e
22
23 export GUILE MES
24 GUILE=${GUILE-guile}
25 MES=${MES-./src/mes}
26
27 tests="
28
29 00-zero.scm
30 01-true.scm
31 02-symbol.scm
32 03-string.scm
33 04-quote.scm
34 05-list.scm
35 06-tick.scm
36 07-if.scm
37 08-if-if.scm
38
39 10-cons.scm
40 11-list.scm
41 12-car.scm
42 13-cdr.scm
43 14-exit.scm
44 15-display.scm
45
46 16-if-eq-quote.scm
47
48 20-define.scm
49 20-define-quoted.scm
50 20-define-quote.scm
51
52 21-define-procedure.scm
53 22-define-procedure-2.scm
54 23-begin.scm
55 24-begin-define.scm
56 25-begin-define-2.scm
57 26-begin-define-later.scm
58 27-lambda-define.scm
59 28-define-define.scm
60 29-lambda-define.scm
61 2a-lambda-lambda.scm
62 2b-define-lambda.scm
63 2c-define-lambda-recurse.scm
64 2d-define-lambda-set.scm
65 2d-compose.scm
66 2e-define-first.scm
67 2f-define-second.scm
68 2f-define-second-lambda.scm
69 2g-vector.scm
70
71 30-capture.scm
72 31-capture-define.scm
73 32-capture-modify-close.scm
74 32-capture-modify-close.scm
75 33-procedure-override-close.scm
76 34-cdr-override-close.scm
77 35-closure-modify.scm
78 36-closure-override.scm
79 37-closure-lambda.scm
80 38-simple-format.scm
81 39-global-define-override.scm
82 3a-global-define-lambda-override.scm
83
84 40-define-macro.scm
85 41-when.scm
86 42-if-when.scm
87 43-or.scm
88 44-or-if.scm
89 45-pass-if.scm
90 46-report.scm
91 47-pass-if-eq.scm
92 48-let.scm
93 49-macro-override.scm
94 4a-define-macro-define-macro.scm
95 4b-define-macro-define.scm
96 4c-quasiquote.scm
97 4d-let-map.scm
98 4e-let-global.scm
99
100 50-primitive-load.scm
101 51-module.scm
102 52-define-module.scm
103 53-closure-display.scm
104
105 60-let-syntax.scm
106 "
107
108 for i in $tests; do
109     echo -n $i
110     if [ ! -f scaffold/boot/$i ]; then
111         echo ' [SKIP]'
112         continue;
113     fi
114     $GUILE -L guile -L . <(echo '(use-modules (mes guile))'; cat scaffold/boot/$i) >& /dev/null
115     x=$(
116         if [ -z "${i/5[0-9]-*/}" ]; then
117             cat scaffold/boot/$i | MES_BOOT=boot-00.scm $MES 2>&1;
118         elif [ -z "${i/6[0-9]-*/}" ]; then
119             cat scaffold/boot/$i | MES_BOOT=boot-01.scm $MES 2>&1;
120         else
121             MES_BOOT=scaffold/boot/$i $MES 2>&1;
122         fi
123      ) \
124         && echo ' [PASS]' \
125         || (r=$?; echo ' [FAIL]'; echo -e "$x"; echo scaffold/boot/$i; exit $r)
126 done