2014-10-14 22:11:49 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2015-05-21 17:29:13 +02:00
|
|
|
set -e
|
|
|
|
ROOT=`pwd`
|
2015-05-21 16:30:14 +02:00
|
|
|
MACHINE=`uname -m`
|
|
|
|
[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc"
|
|
|
|
[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc"
|
|
|
|
[ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc"
|
2015-05-21 17:29:13 +02:00
|
|
|
BUILD="$ROOT/build-$MACHINE-$CC-Debug"
|
2015-05-21 16:30:14 +02:00
|
|
|
|
2014-10-14 23:22:02 +02:00
|
|
|
inifile() {
|
2015-05-21 17:29:13 +02:00
|
|
|
cd $ROOT
|
2014-10-14 23:18:01 +02:00
|
|
|
if [ ! -e eressea.ini ]; then
|
|
|
|
cp conf/eressea.ini .
|
2015-05-21 16:30:14 +02:00
|
|
|
$BUILD/iniparser/inifile eressea.ini add lua:paths lunit:scripts
|
2014-10-14 23:18:01 +02:00
|
|
|
fi
|
2014-10-14 23:22:02 +02:00
|
|
|
}
|
2014-10-14 23:18:01 +02:00
|
|
|
|
2015-05-21 17:29:13 +02:00
|
|
|
build() {
|
|
|
|
cd $BUILD
|
|
|
|
cmake -DCMAKE_MODULE_PATH=$ROOT/cmake/Modules -DCMAKE_BUILD_TYPE=Debug ..
|
|
|
|
make
|
|
|
|
}
|
|
|
|
|
2015-05-21 16:30:14 +02:00
|
|
|
test_valgrind_report () {
|
2015-06-09 08:36:45 +02:00
|
|
|
cd $ROOT/tests
|
2015-05-21 16:30:14 +02:00
|
|
|
ln -sf ../scripts/config.lua
|
2015-05-21 18:03:24 +02:00
|
|
|
valgrind --suppressions=ubuntu-12_04.supp --error-exitcode=1 $BUILD/eressea/eressea -v0 -t184 ../scripts/reports.lua
|
2015-05-21 16:30:14 +02:00
|
|
|
}
|
|
|
|
|
2015-06-09 08:36:45 +02:00
|
|
|
test_valgrind_turn () {
|
|
|
|
cd $ROOT/tests
|
|
|
|
ln -sf ../scripts/config.lua
|
|
|
|
valgrind --suppressions=ubuntu-12_04.supp --error-exitcode=1 $BUILD/eressea/eressea -v0 -t184 ../scripts/run-turn.lua
|
|
|
|
}
|
|
|
|
|
2015-05-21 17:29:13 +02:00
|
|
|
test_unittests() {
|
|
|
|
$BUILD/eressea/test_eressea
|
|
|
|
}
|
|
|
|
|
|
|
|
cleanup() {
|
|
|
|
cd $ROOT/tests
|
2015-06-09 08:36:45 +02:00
|
|
|
rm -rf reports score eressea.log* config.lua data/185.dat datum passwd parteien parteien.full turn
|
2015-05-21 17:29:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
test_server() {
|
|
|
|
cd $ROOT
|
|
|
|
inifile
|
|
|
|
$BUILD/eressea/eressea -v0 scripts/run-tests.lua
|
|
|
|
$BUILD/eressea/eressea -v0 scripts/run-tests-e2.lua
|
|
|
|
$BUILD/eressea/eressea -v0 scripts/run-tests-e3.lua
|
|
|
|
}
|
|
|
|
# information
|
|
|
|
echo "* base directory: $ROOT"
|
|
|
|
echo "* build directory: $BUILD"
|
2015-05-21 17:44:36 +02:00
|
|
|
echo "* lsb_release:"
|
|
|
|
lsb_release -a
|
2015-05-21 17:29:13 +02:00
|
|
|
echo "* zlib1g-dev package:"
|
|
|
|
dpkg -l zlib1g-dev
|
|
|
|
echo
|
|
|
|
|
|
|
|
# build the code
|
2015-05-21 16:30:14 +02:00
|
|
|
[ -d $BUILD ] || mkdir $BUILD
|
2015-05-21 17:29:13 +02:00
|
|
|
build
|
|
|
|
test_unittests
|
|
|
|
test_server
|
2015-05-21 16:30:14 +02:00
|
|
|
test_valgrind_report
|
2015-06-09 08:36:45 +02:00
|
|
|
test_valgrind_turn
|
2015-05-21 17:29:13 +02:00
|
|
|
|
|
|
|
cleanup
|