2014-04-12 05:25:21 +02:00
|
|
|
#!/bin/bash
|
2021-04-28 19:52:45 +02:00
|
|
|
set -ex
|
2020-04-19 21:35:48 +02:00
|
|
|
|
2017-01-30 10:26:08 +01:00
|
|
|
ROOT=$(git rev-parse --show-toplevel)
|
2021-02-22 01:59:41 +01:00
|
|
|
export LUA_PATH="$ROOT/scripts/?.lua;$LUA_PATH"
|
2015-07-11 23:25:09 +02:00
|
|
|
[ -z $BUILD ] && BUILD=Debug ; export BUILD
|
2014-04-12 05:25:21 +02:00
|
|
|
|
2018-02-10 18:52:03 +01:00
|
|
|
UNIT_TESTS=$ROOT/$BUILD/eressea/test_eressea
|
|
|
|
RUN_TESTS=$ROOT/$BUILD/eressea/eressea
|
2017-10-10 21:30:53 +02:00
|
|
|
if [ "$1" = "-V" ]; then
|
2018-02-10 18:52:03 +01:00
|
|
|
SUPP=$ROOT/share/ubuntu-12_04.supp
|
2021-04-28 20:02:24 +02:00
|
|
|
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"
|
2017-10-10 21:30:53 +02:00
|
|
|
fi
|
|
|
|
|
2015-07-11 23:25:09 +02:00
|
|
|
if [ ! -e $ROOT/$BUILD ]; then
|
|
|
|
echo "cannot find build directory $BUILD in $ROOT. did you run cmake-init?"
|
2014-04-12 05:25:21 +02:00
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2018-02-10 18:52:03 +01:00
|
|
|
cd $ROOT/tests
|
2021-02-13 12:15:00 +01:00
|
|
|
$UNIT_TESTS
|
2018-02-10 18:52:03 +01:00
|
|
|
$RUN_TESTS -v1 ../scripts/run-tests.lua
|
|
|
|
$RUN_TESTS -v1 ../scripts/run-tests-e2.lua
|
|
|
|
$RUN_TESTS -v1 ../scripts/run-tests-e3.lua
|
2017-10-10 21:30:53 +02:00
|
|
|
$RUN_TESTS --version
|
2018-02-10 18:52:03 +01:00
|
|
|
rm -rf reports orders.txt score score.alliances datum turn
|
2015-05-21 13:18:52 +02:00
|
|
|
|
2014-07-03 06:35:16 +02:00
|
|
|
cd $OLDWPD
|