3 # GNU Mes --- Maxwell Equations of Software
4 # Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
6 # This file is part of GNU Mes.
8 # GNU 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.
13 # GNU 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.
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
22 . ${srcdest}build-aux/config.sh
23 . ${srcdest}build-aux/trace.sh
26 [ -z "$MESCC" ] && MESCC=scripts/mescc
28 MES_PREFIX=${MES_PREFIX-mes}
32 BLOOD_ELF=${BLOOD_ELF-blood-elf}
33 MES_SEED=${MES_SEED-../mes-seed}
34 MESCC=${MESCC-$(command -v mescc)}
35 [ -z "$MESCC" ] && MESCC=scripts/mescc
36 MES=${MES-$(command -v mes)}
37 [ -z "$MES" ] && MES=src/mes
39 if ! command -v $GUILE > /dev/null; then
43 test_sh=${test_sh-${srcdest}build-aux/test.sh}
44 if [ "$arch" = "x86_64-mes" ]; then
45 test_sh=${srcdest}build-aux/test64.sh
77 17-compare-unsigned-ge
78 17-compare-unsigned-gt
79 17-compare-unsigned-le
80 17-compare-unsigned-lt
81 17-compare-unsigned-char-le
82 17-compare-unsigned-short-le
83 17-compare-unsigned-long-le
94 23-global-pointer-init-null
95 23-global-pointer-init
97 23-global-pointer-pointer-ref
107 36-compare-arithmetic
117 44-switch-fallthrough
118 44-switch-body-fallthrough
121 47-function-expression
141 63-struct-array-assign
142 63-struct-array-compare
153 72-typedef-struct-def
158 76-pointer-arithmetic-pp
159 76-pointer-arithmetic
165 7b-struct-int-array-hello
166 7b-struct-int-array-pointer
170 7e-struct-array-access
171 7f-struct-pointer-arithmetic
172 7g-struct-byte-word-field
174 7i-struct-struct-simple
178 7k-for-each-elem-simple
180 7l-struct-any-size-array-simple
181 7l-struct-any-size-array
182 7m-struct-char-array-assign
183 7n-struct-struct-array
184 7o-struct-pre-post-simple
205 83-heterogenoous-init
230 17-compare-unsigned-char-le
231 17-compare-unsigned-short-le
239 expect=$(echo $broken | wc -w)
243 mkdir -p scaffold/tests
245 if [ -z "${t/[012][0-9]-*/}" ]; then
248 elif [ -z "${t/[34][0-9]-*/}" ]; then
251 elif [ -z "${t/[78][0-9a-z]-*/}" ]; then
254 elif [ -z "${t/9[0-9]-*/}" ]; then
261 sh $test_sh "scaffold/tests/$t" &> scaffold/tests/"$t".log
273 [ $expect != 0 ] && echo "expect: $expect"
274 [ $fail != 0 ] && echo "failed: $fail"
275 [ $fail -lt $expect ] && echo "solved: $(($expect - $fail))"
278 if [ $fail != 0 -a $fail -gt $expect ]; then
279 echo FAILED: $fail/$total
281 elif [ $fail != 0 ]; then
282 echo PASS: $pass/$total