diff --git a/.travis.yml b/.travis.yml index cbf3ff239..da3381bdc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ compiler: script: s/travis-build before_install: - sudo apt-get update -qq - - sudo apt-get install -qq libtolua-dev liblua5.1-dev libncurses5-dev libsqlite3-dev libxml2-dev + - sudo apt-get install -qq zlib1g-dev libtolua-dev liblua5.1-dev libncurses5-dev libsqlite3-dev libxml2-dev valgrind os: - linux - osx diff --git a/s/runtests b/s/runtests index 7aea152b5..17df4e165 100755 --- a/s/runtests +++ b/s/runtests @@ -1,4 +1,7 @@ #!/bin/bash + +set -e + ROOT=$(pwd) while [ ! -d $ROOT/.git ]; do ROOT=$(dirname $ROOT) @@ -15,10 +18,11 @@ if [ ! -d $ROOT/$BIN_DIR ]; then exit fi -$ROOT/$BIN_DIR/eressea/test_eressea || exit $? +$ROOT/$BIN_DIR/eressea/test_eressea cd $ROOT [ -e eressea.ini ] || ln -sf conf/eressea.ini -$ROOT/$BIN_DIR/eressea/eressea -v0 scripts/run-tests.lua || exit $? -$ROOT/$BIN_DIR/eressea/eressea -v0 scripts/run-tests-e2.lua || exit $? -$ROOT/$BIN_DIR/eressea/eressea -v0 scripts/run-tests-e3.lua || exit $? +$ROOT/$BIN_DIR/eressea/eressea -v0 scripts/run-tests.lua +$ROOT/$BIN_DIR/eressea/eressea -v0 scripts/run-tests-e2.lua +$ROOT/$BIN_DIR/eressea/eressea -v0 scripts/run-tests-e3.lua + cd $OLDWPD diff --git a/s/travis-build b/s/travis-build index b34b90d02..4724d04b0 100755 --- a/s/travis-build +++ b/s/travis-build @@ -1,18 +1,63 @@ #!/bin/sh +set -e +ROOT=`pwd` +MACHINE=`uname -m` +[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc" +[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc" +[ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc" +BUILD="$ROOT/build-$MACHINE-$CC-Debug" + inifile() { +cd $ROOT if [ ! -e eressea.ini ]; then cp conf/eressea.ini . -build/iniparser/inifile eressea.ini add lua:paths lunit:scripts +$BUILD/iniparser/inifile eressea.ini add lua:paths lunit:scripts fi } -[ -d build ] || mkdir build -cd build && cmake .. \ - -DCMAKE_MODULE_PATH=$PWD/../cmake/Modules \ - -DCMAKE_BUILD_TYPE=Debug .. && \ -make && cd .. && inifile && -build/eressea/test_eressea && -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 +build() { +cd $BUILD +cmake -DCMAKE_MODULE_PATH=$ROOT/cmake/Modules -DCMAKE_BUILD_TYPE=Debug .. +make +} + +test_valgrind_report () { +cd tests +ln -sf ../scripts/config.lua +valgrind --suppressions=ubuntu-12_04.supp --error-exitcode=1 $BUILD/eressea/eressea -v0 -t184 ../scripts/reports.lua +} + +test_unittests() { +$BUILD/eressea/test_eressea +} + +cleanup() { +cd $ROOT/tests +rm -rf reports score eressea.log* config.lua +} + +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" +echo "* lsb_release:" +lsb_release -a +echo "* zlib1g-dev package:" +dpkg -l zlib1g-dev +echo + +# build the code +[ -d $BUILD ] || mkdir $BUILD +build +test_unittests +test_server +test_valgrind_report + +cleanup diff --git a/tests/eressea.ini b/tests/eressea.ini index 9f324fe71..e84171d45 100644 --- a/tests/eressea.ini +++ b/tests/eressea.ini @@ -1,4 +1,3 @@ - [eressea] base = . report = reports @@ -13,7 +12,3 @@ install = .. paths = lunit:scripts maxnmrs = 20 rules = e2 - -[editor] -color = 1 - diff --git a/tests/ubuntu-12_04.supp b/tests/ubuntu-12_04.supp new file mode 100644 index 000000000..29862fa2b --- /dev/null +++ b/tests/ubuntu-12_04.supp @@ -0,0 +1,16 @@ +{ + zlib1g-dev-1:1.2.3.4.dfsg + Memcheck:Cond + fun:inflateReset2 + fun:inflateInit2_ + obj:/usr/lib/x86_64-linux-gnu/libxml2.so.2.8.0 + fun:__libxml2_xzread + obj:/usr/lib/x86_64-linux-gnu/libxml2.so.2.8.0 + fun:xmlParserInputBufferGrow + fun:xmlParserInputGrow + obj:/usr/lib/x86_64-linux-gnu/libxml2.so.2.8.0 + fun:xmlParseDocument + obj:/usr/lib/x86_64-linux-gnu/libxml2.so.2.8.0 + fun:read_xml + fun:init_data +}