Fixed broken test scripts sum.sh and all.sh

This commit is contained in:
Olof hagsand 2021-04-14 17:13:02 +02:00
parent 172cfd69b3
commit 1cd0eab7ff
2 changed files with 7 additions and 7 deletions

View file

@ -25,7 +25,7 @@ if [ $# -gt 0 ]; then
exit -1 exit -1
fi fi
err=0 allerr=0
testnr=0 testnr=0
for test in $pattern; do for test in $pattern; do
if [ $testnr != 0 ]; then echo; fi if [ $testnr != 0 ]; then echo; fi
@ -33,13 +33,13 @@ for test in $pattern; do
. ./$test . ./$test
errcode=$? errcode=$?
if [ $errcode -ne 0 ]; then if [ $errcode -ne 0 ]; then
err=1 allerr=1
echo -e "\e[31mError in $test errcode=$errcode" echo -e "\e[31mError in $test errcode=$errcode"
echo -ne "\e[0m" echo -ne "\e[0m"
exit $errcode exit $errcode
fi fi
done done
if [ $err -eq 0 ]; then if [ $allerr -eq 0 ]; then
echo "OK, ${testnr} tests" echo "OK, ${testnr} tests"
else else
echo -e "\e[31mError" echo -e "\e[31mError"

View file

@ -25,21 +25,21 @@ if [ $# -gt 0 ]; then
exit -1 exit -1
fi fi
let err=0 # error counter let sumerr=0 # error counter
for testfile in $pattern; do # For lib.sh the variable must be called testfile for testfile in $pattern; do # For lib.sh the variable must be called testfile
echo "Running $testfile" echo "Running $testfile"
./$testfile > /dev/null 2>&1 ./$testfile > /dev/null 2>&1
errcode=$? errcode=$?
if [ $errcode -ne 0 ]; then if [ $errcode -ne 0 ]; then
let err++ let sumerr++
echo -e "\e[31mError in $testfile errcode=$errcode" echo -e "\e[31mError in $testfile errcode=$errcode"
echo -ne "\e[0m" echo -ne "\e[0m"
fi fi
done done
if [ $err -eq 0 ]; then if [ $sumerr -eq 0 ]; then
echo "OK" echo "OK"
else else
echo -e "\e[31m${err} Errors" echo -e "\e[31m${sumerr} Errors"
echo -ne "\e[0m" echo -ne "\e[0m"
exit -1 exit -1
fi fi