build: Support building with Gash.

* build-aux/check-mes.sh: Replace unspported $((..)) by $(expr ...).
* build-aux/check-mescc.sh: Likewise.
* build-aux/check-tcc.sh: Likewise.
This commit is contained in:
Jan Nieuwenhuizen 2018-12-31 18:37:18 +01:00
parent 472ea876d4
commit 3b802ff77c
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
5 changed files with 19 additions and 19 deletions

View File

@ -66,14 +66,14 @@ for t in $tests; do
echo $t: [SKIP];
continue
fi
${top_builddir}/pre-inst-env sh "$t" &> $t.${mes}log
${top_builddir}/pre-inst-env sh "$t" > $t.${mes}log 2>&1
r=$?
total=$((total+1))
total=$(expr $total + 1)
if [ $r = 0 ]; then
echo $t: [${mes}OK]
else
echo $t: [${mes}FAIL]
fail=$((fail+1))
fail=$(expr $fail + 1)
fi
done
if [ $fail != 0 ]; then

View File

@ -248,21 +248,21 @@ for t in $tests; do
else
libc='-l c'
fi
sh $test_sh "$t" &> "$t".log
sh $test_sh "$t" > "$t".log 2>&1
r=$?
total=$((total+1))
total=$(expr $total + 1)
if [ $r = 0 ]; then
echo $t: [OK]
pass=$((pass+1))
pass=$(expr $pass + 1)
else
echo $t: [FAIL]
fail=$((fail+1))
fail=$(expr $fail + 1)
fi
done
[ $expect != 0 ] && echo "expect: $expect"
[ $fail != 0 ] && echo "failed: $fail"
[ $fail -lt $expect ] && echo "solved: $(($expect - $fail))"
[ $fail -lt $expect ] && echo "solved: $(expr $expect - $fail)"
echo "passed: $pass"
echo "total: $total"
if [ $fail != 0 -a $fail -gt $expect ]; then

View File

@ -135,20 +135,20 @@ for t in $tests; do
continue;
fi
cp $TINYCC_PREFIX/tests/tests2/$i* scaffold/tinycc
sh ${srcdest}build-aux/test.sh "scaffold/tinycc/$t" &> scaffold/tinycc/"$t".log
sh ${srcdest}build-aux/test.sh "scaffold/tinycc/$t" > scaffold/tinycc/"$t".log 2>&1
r=$?
total=$((total+1))
total=$(expr $total + 1)
if [ $r = 0 ]; then
echo $t: [OK]
pass=$((pass+1))
pass=$(expr $pass + 1)
else
echo $t: [FAIL]
fail=$((fail+1))
fail=$(expr $fail + 1)
fi
done
[ $expect != 0 ] && echo "expect: $expect"
[ $fail != 0 ] && echo "failed: $fail"
[ $fail -lt $expect ] && echo "solved: $(($expect - $fail))"
[ $fail -lt $expect ] && echo "solved: $(expr $expect - $fail)"
echo "passed: $pass"
echo "total: $total"
if [ $fail != 0 -a $fail -gt $expect ]; then

View File

@ -25,8 +25,8 @@ set -e
. ${srcdest}build-aux/trace.sh
./pre-inst-env bash ${srcdest}build-aux/check-boot.sh
./pre-inst-env bash ${srcdest}build-aux/check-mes.sh
./pre-inst-env bash ${srcdest}build-aux/check-mescc.sh
./pre-inst-env sh ${srcdest}build-aux/check-mes.sh
./pre-inst-env sh ${srcdest}build-aux/check-mescc.sh
if [ -d $TINYCC_PREFIX/tests/tests2 ] ;then
./pre-inst-env bash ${srcdest}build-aux/check-tcc.sh
./pre-inst-env sh ${srcdest}build-aux/check-tcc.sh
fi

View File

@ -1,7 +1,7 @@
#! /bin/sh
# GNU Mes --- Maxwell Equations of Software
# Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
# Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
#
# This file is part of GNU Mes.
#
@ -25,7 +25,7 @@ set -e
mes_prefix=@prefix@/share/mes
# use bash or lose if pipes fail
if [ "$(basename $SHELL)" == bash ]; then
if [ "$(basename $SHELL)" = bash ]; then
set -o pipefail
fi
@ -39,7 +39,7 @@ cp scripts/mescc $DESTDIR@bindir@/mescc
sed \
-e "s,^#! /bin/sh,#! @SHELL@," \
scripts/diff.scm > $DESTDIR@bindir@/diff.scm
chmod -w+x $DESTDIR@bindir@/diff.scm
chmod +x $DESTDIR@bindir@/diff.scm
mkdir -p $DESTDIR@docdir@