forked from github/server
77a8c24ead
make all tests run from inside the tests directory
31 lines
870 B
Bash
Executable file
31 lines
870 B
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
|
|
ROOT=$(git rev-parse --show-toplevel)
|
|
[ -z $BUILD ] && BUILD=Debug ; export BUILD
|
|
|
|
UNIT_TESTS=$ROOT/$BUILD/eressea/test_eressea
|
|
RUN_TESTS=$ROOT/$BUILD/eressea/eressea
|
|
if [ "$1" = "-V" ]; then
|
|
VALGRIND=$(which valgrind)
|
|
if [ -n "$VALGRIND" ]; then
|
|
SUPP=$ROOT/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
|
|
|
|
$UNIT_TESTS
|
|
cd $ROOT/tests
|
|
$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 reports orders.txt score score.alliances datum turn
|
|
|
|
cd $OLDWPD
|