3 # GNU Mes --- Maxwell Equations of Software
4 # Copyright © 2018,2019 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/>.
27 t=${1-lib/tests/scaffold/t.c}
28 b=$(dirname "$t")/$(basename "$t" .c)
30 o=lib/tests/${b#*lib/tests/}
31 if [ "$o" = "$b" ]; then
39 if [ -z "${i/[012][0-9]-*/}" ]; then
41 elif [ -z "${i/[34][0-9]-*/}" ]; then
43 elif [ -z "${i/[78][0-9a-z]-*/}" ]; then
45 elif [ -z "${i/9[0-9a-z]-*/}" ]; then
51 if test $mes_libc = system; then
58 $CC -c $CPPFLAGS $CFLAGS -o "$o".o "$t"
59 $CC $CFLAGS $LDFLAGS -L . -o "$o" $crt1 "$o".o $LIBS
62 timeout 2 "$o" -s --long file0 file1 > "$o".1 2> "$o".2
65 if [ -f "$b".exit ]; then
71 if [ -f "$b".stdout ]; then
72 $DIFF -ub "$b".stdout "$o".1
74 if [ -f "$b".stderr ]; then
75 $DIFF -ub "$b".stderr "$o".2