Hash :
6c536e4b
Author :
Date :
2015-11-25T09:41:58
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
#!/bin/bash
#
# return values of this script are:
# 0 success
# 128 a test failed
# >0 the number of timed-out tests
set -e
ret=0
TEST_CFLAGS=""
if [ "$#" == "1" ]
then
MAKE_OPTIONS=$1
fi
_die()
{
echo "error $2 while $1"
if [ "$2" != "124" ]
then
exit 128
else
echo "assuming timeout while running test - continue"
ret=$(( $ret + 1 ))
fi
}
_runtest()
{
echo -ne " Compile $1 $2"
make clean > /dev/null
CC="$1" CFLAGS="$2 $TEST_CFLAGS" make -j8 test_standalone $MAKE_OPTIONS > /dev/null 2>test_errors.txt
echo -e "\rRun test $1 $2"
timeout --foreground 90 ./test > test_$(echo ${1}${2} | tr ' ' '_').txt || _die "running tests" $?
}
compilers=( $COMPILERS gcc )
echo "uname="$(uname -a)
for i in "${compilers[@]}"
do
if [ -z "$(which $i)" ]
then
continue
fi
compiler_version=$(echo "$i="$($i -dumpversion))
if [ "$compiler_version" == "clang=4.2.1" ]
then
# one of my versions of clang complains about some stuff in stdio.h and stdarg.h ...
TEST_CFLAGS="-Wno-typedef-redefinition"
else
TEST_CFLAGS=""
fi
echo $compiler_version
_runtest "$i" ""
_runtest "$i" "-DMP_8BIT"
_runtest "$i" "-DMP_16BIT"
_runtest "$i" "-DMP_32BIT"
_runtest "$i -m32" ""
_runtest "$i -m32" "-DMP_8BIT"
_runtest "$i -m32" "-DMP_16BIT"
_runtest "$i -m32" "-DMP_32BIT"
if [ "$i" != "clang" ]
then
_runtest "$i -mx32" ""
_runtest "$i -mx32" "-DMP_8BIT"
_runtest "$i -mx32" "-DMP_16BIT"
_runtest "$i -mx32" "-DMP_32BIT"
fi
done
if [ "$ret" == "0" ]
then
echo "Tests successful"
else
echo "$ret tests timed out"
fi
exit $ret