add valgrind option to runtests, use in travis builds

This commit is contained in:
Enno Rehling 2017-10-10 21:30:53 +02:00
parent 9527460ca4
commit ed23853c4d
2 changed files with 17 additions and 6 deletions

View File

@ -4,18 +4,29 @@ set -e
ROOT=$(git rev-parse --show-toplevel) ROOT=$(git rev-parse --show-toplevel)
[ -z $BUILD ] && BUILD=Debug ; export BUILD [ -z $BUILD ] && BUILD=Debug ; export BUILD
UNIT_TESTS=$BUILD/eressea/test_eressea
RUN_TESTS=$BUILD/eressea/eressea
if [ "$1" = "-V" ]; then
VALGRIND=$(which valgrind)
if [ -n "$VALGRIND" ]; then
SUPP=share/ubuntu-12_04.supp
UNIT_TESTS="$VALGRIND --quiet --suppressions=$SUPP --error-exitcode=1 --leak-check=no $UNIT_TESTS"
RUN_TESTS="$VALGRIND --quiet --suppressions=$SUPP --error-exitcode=1 --leak-check=no $RUN_TESTS"
fi
fi
if [ ! -e $ROOT/$BUILD ]; then if [ ! -e $ROOT/$BUILD ]; then
echo "cannot find build directory $BUILD in $ROOT. did you run cmake-init?" echo "cannot find build directory $BUILD in $ROOT. did you run cmake-init?"
exit exit
fi fi
$ROOT/$BUILD/eressea/test_eressea $UNIT_TESTS
cd $ROOT cd $ROOT
[ -e eressea.ini ] || ln -sf conf/eressea.ini [ -e eressea.ini ] || ln -sf conf/eressea.ini
$ROOT/$BUILD/eressea/eressea -v1 scripts/run-tests.lua $RUN_TESTS -v1 scripts/run-tests.lua
$ROOT/$BUILD/eressea/eressea -v1 scripts/run-tests-e2.lua $RUN_TESTS -v1 scripts/run-tests-e2.lua
$ROOT/$BUILD/eressea/eressea -v1 scripts/run-tests-e3.lua $RUN_TESTS -v1 scripts/run-tests-e3.lua
$ROOT/$BUILD/eressea/eressea --version $RUN_TESTS --version
rm -rf data reports orders.txt score score.alliances datum turn rm -rf data reports orders.txt score score.alliances datum turn
cd $OLDWPD cd $OLDWPD

View File

@ -22,6 +22,6 @@ s/cmake-init
s/build s/build
cd $ROOT cd $ROOT
inifile inifile
s/runtests s/runtests -V
integration_tests integration_tests