improve testme.sh

This commit is contained in:
Steffen Jaeckel 2017-04-10 16:30:40 +02:00
parent 3ab918e7ea
commit db66145774
2 changed files with 20 additions and 8 deletions

1
.gitignore vendored
View File

@ -47,6 +47,7 @@ mtest.exe
tommath.tex
# ignore files generated by testme.sh
gcc_errors_*.txt
test_*.txt
*.bak

View File

@ -67,9 +67,16 @@ _runtest()
{
echo -ne " Compile $1 $2"
make clean > /dev/null
CC="$1" CFLAGS="$2 $TEST_CFLAGS" make -j$MAKE_JOBS test_standalone $MAKE_OPTIONS > /dev/null 2>test_errors.txt
suffix=$(echo ${1}${2} | tr ' ' '_')
CC="$1" CFLAGS="$2 $TEST_CFLAGS" make -j$MAKE_JOBS test_standalone $MAKE_OPTIONS > /dev/null 2>gcc_errors_${suffix}.txt
errcnt=$(wc -l < gcc_errors_${suffix}.txt)
if [[ ${errcnt} -gt 1 ]]; then
echo " failed"
cat gcc_errors_${suffix}.txt
exit 128
fi
echo -e "\rRun test $1 $2"
timeout --foreground 90 ./test > test_$(echo ${1}${2} | tr ' ' '_').txt || _die "running tests" $?
timeout --foreground 90 ./test > test_${suffix}.txt || _die "running tests" $?
}
_banner()
@ -120,8 +127,12 @@ do
shift
done
# default to gcc if nothing is given
if [[ "$COMPILERS" == "" ]]
# default to gcc if no compiler is defined but some other options
if [[ "$COMPILERS" == "" ]] && [[ "$ARCHFLAGS$MAKE_OPTIONS$CFLAGS" != "" ]]
then
COMPILERS="gcc"
# default to gcc and run only default config if no option is given
elif [[ "$COMPILERS" == "" ]]
then
_banner gcc
_runtest "gcc" ""
@ -164,10 +175,10 @@ do
continue
fi
_runtest "$i $a" ""
_runtest "$i $a" "-DMP_8BIT"
_runtest "$i $a" "-DMP_16BIT"
_runtest "$i $a" "-DMP_32BIT"
_runtest "$i $a" "$CFLAGS"
_runtest "$i $a" "-DMP_8BIT $CFLAGS"
_runtest "$i $a" "-DMP_16BIT $CFLAGS"
_runtest "$i $a" "-DMP_32BIT $CFLAGS"
done
done