diff --git a/.travis.yml b/.travis.yml index 7bbbdfb1a..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 valgrind + - 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/travis-build b/s/travis-build index e8643f87e..51a501c15 100755 --- a/s/travis-build +++ b/s/travis-build @@ -1,31 +1,61 @@ #!/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="build-$MACHINE-$CC-Debug" +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 fi } +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 ../$BUILD/eressea/eressea -v0 -t184 ../scripts/reports.lua +valgrind $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 "* zlib1g-dev package:" +dpkg -l zlib1g-dev +echo + +# build the code [ -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 +test_unittests +test_server test_valgrind_report + +cleanup