0d5aaffb1be10fa45e418de6ba5f7b59823d6b46
[mes.git] / build-aux / check-mes.sh
1 #! /bin/sh
2
3 # Mes --- Maxwell Equations of Software
4 # Copyright © 2017,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 export BASH
22 export GUILE MES MES_ARENA
23 export BUILD_DEBUG
24
25 if [ "$MES" = guile ]; then
26     mes=guile-
27 fi
28 BASH=${BASH-bash}
29 GUILE=${GUILE-guile}
30 MES=${MES-src/mes}
31 MES_ARENA=${MES_ARENA-100000000}
32
33 set -e
34
35 tests="
36 tests/boot.test
37 tests/read.test
38 tests/base.test
39 tests/quasiquote.test
40 tests/let.test
41 tests/closure.test
42 tests/scm.test
43 tests/display.test
44 tests/cwv.test
45 tests/math.test
46 tests/vector.test
47 tests/srfi-1.test
48 tests/srfi-9.test
49 tests/srfi-13.test
50 tests/srfi-14.test
51 tests/srfi-43.test
52 tests/optargs.test
53 tests/fluids.test
54 tests/catch.test
55 tests/getopt-long.test
56 tests/guile.test
57 tests/syntax.test
58 tests/let-syntax.test
59 tests/pmatch.test
60 tests/match.test
61 tests/psyntax.test
62 "
63
64 slow_or_broken="
65 tests/peg.test
66 "
67
68 set +e
69 fail=0
70 total=0
71 for t in $tests; do
72     if [ ! -f $t ]; then
73         echo $t: [SKIP];
74         continue
75     fi
76     ./pre-inst-env sh "$t" &> $t.${mes}log
77     r=$?
78     total=$((total+1))
79     if [ $r = 0 ]; then
80         echo $t: [${mes}OK]
81     else
82         echo $t: [${mes}FAIL]
83         fail=$((fail+1))
84     fi
85 done
86 if [ $fail != 0 ]; then
87     echo FAILED: $fail/$total
88     exit 1
89 else
90     echo PASS: $total
91 fi