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