build: Support Debian build, install.
[mes.git] / check.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 CC32
23 export GUILE MES MES_ARENA
24 export BUILD_DEBUG
25
26 BASH=${BASH-bash}
27 CC32=${CC32-$(command -v i686-unknown-linux-gnu-gcc)}
28 GUILE=${GUILE-guile}
29 MES=${MES-src/mes}
30 MES_ARENA=${MES_ARENA-100000000}
31 PREFIX=
32
33 if ! command -v $GUILE > /dev/null; then
34     GUILE=true
35 fi
36
37 set -e
38 bash build-aux/check-boot.sh
39
40 tests="
41 tests/boot.test
42 tests/read.test
43 tests/base.test
44 tests/quasiquote.test
45 tests/let.test
46 tests/closure.test
47 tests/scm.test
48 tests/display.test
49 tests/cwv.test
50 tests/math.test
51 tests/vector.test
52 tests/srfi-1.test
53 tests/srfi-9.test
54 tests/srfi-13.test
55 tests/srfi-14.test
56 tests/srfi-43.test
57 tests/optargs.test
58 tests/fluids.test
59 tests/catch.test
60 tests/getopt-long.test
61 tests/guile.test
62 tests/syntax.test
63 tests/let-syntax.test
64 tests/pmatch.test
65 tests/match.test
66 tests/psyntax.test
67 "
68
69 slow_or_broken="
70 tests/peg.test
71 "
72
73 tests=$(for t in $tests; do echo $t-guile; echo $t; done)
74
75 set +e
76 fail=0
77 total=0
78 for t in $tests; do
79     if [ ! -f $t ]; then
80         echo $t: [SKIP];
81         continue
82     fi
83     sh "$t" &> $t.log
84     r=$?
85     total=$((total+1))
86     if [ $r = 0 ]; then
87         echo $t: [OK]
88     else
89         echo $t: [FAIL]
90         fail=$((fail+1))
91     fi
92 done
93 if [ $fail != 0 ]; then
94     echo FAILED: $fail/$total
95     exit 1
96 else
97     echo PASS: $total
98 fi
99
100 $BASH build-aux/check-mescc.sh