2018-04-29 16:38:57 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
2018-07-22 12:24:36 +00:00
|
|
|
# GNU Mes --- Maxwell Equations of Software
|
2018-04-29 16:38:57 +00:00
|
|
|
# Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
|
|
|
#
|
2018-07-22 12:24:36 +00:00
|
|
|
# This file is part of GNU Mes.
|
2018-04-29 16:38:57 +00:00
|
|
|
#
|
2018-07-22 12:24:36 +00:00
|
|
|
# GNU Mes is free software; you can redistribute it and/or modify it
|
2018-04-29 16:38:57 +00:00
|
|
|
# under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
# your option) any later version.
|
|
|
|
#
|
2018-07-22 12:24:36 +00:00
|
|
|
# GNU Mes is distributed in the hope that it will be useful, but
|
2018-04-29 16:38:57 +00:00
|
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2018-07-22 12:24:36 +00:00
|
|
|
# along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
2018-04-29 16:38:57 +00:00
|
|
|
|
2018-07-21 22:43:39 +00:00
|
|
|
set -e
|
2018-07-25 06:14:13 +00:00
|
|
|
. ${srcdest}build-aux/config.sh
|
|
|
|
. ${srcdest}build-aux/trace.sh
|
2018-04-29 16:38:57 +00:00
|
|
|
|
2018-07-21 05:15:52 +00:00
|
|
|
MES_ARENA=100000000
|
|
|
|
|
2018-05-01 14:50:29 +00:00
|
|
|
GUILE=${GUILE-$MES}
|
|
|
|
DIFF=${DIFF-$(command -v diff)}
|
2018-07-25 06:14:13 +00:00
|
|
|
[ -z "$DIFF" ] && DIFF="sh scripts/diff.scm"
|
2018-05-01 14:50:29 +00:00
|
|
|
|
2018-04-29 16:38:57 +00:00
|
|
|
t=${1-scaffold/tests/t}
|
2018-07-25 06:14:13 +00:00
|
|
|
o="$t"
|
2018-07-21 22:43:39 +00:00
|
|
|
rm -f "$o".mes-out
|
2018-05-03 18:32:06 +00:00
|
|
|
shift
|
2018-04-29 16:38:57 +00:00
|
|
|
|
2018-05-03 18:32:06 +00:00
|
|
|
set -e
|
|
|
|
|
2018-07-21 22:43:39 +00:00
|
|
|
rm -f "$o".gcc-out
|
2018-06-02 09:41:06 +00:00
|
|
|
if [ -n "$CC" ]; then
|
2018-07-25 06:14:13 +00:00
|
|
|
sh ${srcdest}build-aux/cc.sh "$t"
|
2018-06-02 09:41:06 +00:00
|
|
|
|
|
|
|
r=0
|
|
|
|
[ -f "$t".exit ] && r=$(cat "$t".exit)
|
|
|
|
set +e
|
2018-07-21 22:43:39 +00:00
|
|
|
"$o".gcc-out $ARGS > "$o".gcc-stdout
|
2018-06-02 09:41:06 +00:00
|
|
|
m=$?
|
2018-07-21 22:43:39 +00:00
|
|
|
cat "$o".gcc-stdout
|
2018-06-02 09:41:06 +00:00
|
|
|
set -e
|
|
|
|
|
|
|
|
[ $m = $r ]
|
|
|
|
if [ -f "$t".expect ]; then
|
2018-07-21 22:43:39 +00:00
|
|
|
$DIFF -ub "$t".expect "$o".gcc-stdout;
|
2018-06-02 09:41:06 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2018-05-29 18:07:46 +00:00
|
|
|
rm -f "$t".mes-gcc-out
|
2018-05-04 19:24:39 +00:00
|
|
|
if [ -n "$CC32" ]; then
|
2018-07-25 06:14:13 +00:00
|
|
|
sh ${srcdest}build-aux/cc32-mes.sh "$t"
|
2018-05-04 19:24:39 +00:00
|
|
|
|
|
|
|
r=0
|
|
|
|
[ -f "$t".exit ] && r=$(cat "$t".exit)
|
|
|
|
set +e
|
2018-07-21 22:43:39 +00:00
|
|
|
"$o".mes-gcc-out $ARGS > "$o".mes-gcc-stdout
|
2018-05-04 19:24:39 +00:00
|
|
|
m=$?
|
2018-05-29 18:07:46 +00:00
|
|
|
cat "$t".mes-gcc-stdout
|
2018-05-04 19:24:39 +00:00
|
|
|
set -e
|
|
|
|
|
|
|
|
[ $m = $r ]
|
|
|
|
if [ -f "$t".expect ]; then
|
2018-07-21 22:43:39 +00:00
|
|
|
$DIFF -ub "$t".expect "$o".mes-gcc-stdout;
|
2018-05-04 19:24:39 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2018-07-21 22:43:39 +00:00
|
|
|
rm -f "$o".mes-out
|
2018-07-25 06:14:13 +00:00
|
|
|
sh ${srcdest}build-aux/cc-mes.sh "$t"
|
2018-04-29 16:38:57 +00:00
|
|
|
|
|
|
|
r=0
|
2018-05-01 14:50:29 +00:00
|
|
|
[ -f "$t".exit ] && r=$(cat "$t".exit)
|
2018-04-29 16:38:57 +00:00
|
|
|
set +e
|
2018-07-21 22:43:39 +00:00
|
|
|
"$o".mes-out $ARGS > "$o".mes-stdout
|
2018-04-29 16:38:57 +00:00
|
|
|
m=$?
|
2018-07-21 22:43:39 +00:00
|
|
|
cat "$o".mes-stdout
|
2018-05-01 14:50:29 +00:00
|
|
|
set -e
|
2018-04-29 16:38:57 +00:00
|
|
|
|
|
|
|
[ $m = $r ]
|
|
|
|
if [ -f "$t".expect ]; then
|
2018-07-21 22:43:39 +00:00
|
|
|
$DIFF -ub "$t".expect "$o".mes-stdout;
|
2018-04-29 16:38:57 +00:00
|
|
|
fi
|