From ed23853c4d5de25fec5e1c521e4ba99498f7b276 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 10 Oct 2017 21:30:53 +0200 Subject: [PATCH] add valgrind option to runtests, use in travis builds --- s/runtests | 21 ++++++++++++++++----- s/travis-build | 2 +- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/s/runtests b/s/runtests index 14b5a658b..7a39670dd 100755 --- a/s/runtests +++ b/s/runtests @@ -4,18 +4,29 @@ set -e ROOT=$(git rev-parse --show-toplevel) [ -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 echo "cannot find build directory $BUILD in $ROOT. did you run cmake-init?" exit fi -$ROOT/$BUILD/eressea/test_eressea +$UNIT_TESTS cd $ROOT [ -e eressea.ini ] || ln -sf conf/eressea.ini -$ROOT/$BUILD/eressea/eressea -v1 scripts/run-tests.lua -$ROOT/$BUILD/eressea/eressea -v1 scripts/run-tests-e2.lua -$ROOT/$BUILD/eressea/eressea -v1 scripts/run-tests-e3.lua -$ROOT/$BUILD/eressea/eressea --version +$RUN_TESTS -v1 scripts/run-tests.lua +$RUN_TESTS -v1 scripts/run-tests-e2.lua +$RUN_TESTS -v1 scripts/run-tests-e3.lua +$RUN_TESTS --version rm -rf data reports orders.txt score score.alliances datum turn cd $OLDWPD diff --git a/s/travis-build b/s/travis-build index 9293ac12d..438f2ce36 100755 --- a/s/travis-build +++ b/s/travis-build @@ -22,6 +22,6 @@ s/cmake-init s/build cd $ROOT inifile -s/runtests +s/runtests -V integration_tests