tomsfastmath/testme.sh

36 lines
812 B
Bash
Raw Normal View History

2015-02-15 14:53:09 +01:00
#!/bin/bash -e
#
# Can be run with e.g. ./testme.sh "gcc-4.8 gcc-4.9", defaults to ./testme.sh "gcc"
_runtest()
{
echo -n "Run test $1 $2"
2015-02-15 23:40:45 +01:00
trap 'echo " - build not successful, errors are:" && cat test_gcc_errors.txt' INT TERM EXIT
2015-02-15 14:53:09 +01:00
make clean > /dev/null
2015-02-15 15:13:20 +01:00
CC="${1}" make test_standalone -j9 $2 > /dev/null 2>test_gcc_errors.txt
2015-02-15 23:40:45 +01:00
trap - INT TERM EXIT
2015-02-15 14:53:09 +01:00
local outfile="test_$(echo ${1}${2} | tr -d '\"' | tr ' ' '_').txt"
2015-02-15 23:40:45 +01:00
trap 'echo " - tests not successful, failed at:" && tail ${outfile}' INT TERM EXIT
2015-02-15 14:53:09 +01:00
./test > ${outfile}
echo " successful"
2015-02-15 23:40:45 +01:00
trap - INT TERM EXIT
2015-02-15 14:53:09 +01:00
}
gccopt="-m32 -m64 -mx32"
if [ $# -ge 1 ]
then
gccver=$1
else
gccver="gcc"
fi
for gopt in ${gccopt};
do
for gccv in ${gccver};
do
_runtest "${gccv} ${gopt}" "-f makefile.shared"
_runtest "${gccv} ${gopt}" ""
done
done