From 5c62bf2401a55d999f5ae1d52310751db446828d Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 21 May 2015 13:18:52 +0200 Subject: [PATCH 1/7] include valgrind in the travis build --- .travis.yml | 2 +- s/runtests | 1 + s/travis-build | 7 ++++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index cbf3ff239..7bbbdfb1a 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 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..82c49251e 100755 --- a/s/runtests +++ b/s/runtests @@ -21,4 +21,5 @@ cd $ROOT $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 $? + cd $OLDWPD diff --git a/s/travis-build b/s/travis-build index b34b90d02..91f6a5f3c 100755 --- a/s/travis-build +++ b/s/travis-build @@ -13,6 +13,7 @@ cd build && cmake .. \ -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/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 && +(cd tests ; valgrind ../build/eressea/eressea -v0 -t184 ../scripts/reports.lua ) From f69d46404cdb198c7367e079e19851931576b7da Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 21 May 2015 13:23:07 +0200 Subject: [PATCH 2/7] remove cruft from ini file --- tests/eressea.ini | 5 ----- 1 file changed, 5 deletions(-) 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 - From f29d573c3e58e30ac2ccb62381784b198e072401 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 21 May 2015 16:30:14 +0200 Subject: [PATCH 3/7] fix travis build writing reports with valgrind --- s/travis-build | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/s/travis-build b/s/travis-build index 91f6a5f3c..e8643f87e 100755 --- a/s/travis-build +++ b/s/travis-build @@ -1,19 +1,31 @@ #!/bin/sh +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" + inifile() { 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 .. \ +test_valgrind_report () { +cd tests +ln -sf ../scripts/config.lua +valgrind ../$BUILD/eressea/eressea -v0 -t184 ../scripts/reports.lua +} + +[ -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 && -(cd tests ; valgrind ../build/eressea/eressea -v0 -t184 ../scripts/reports.lua ) +$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 && +test_valgrind_report From ac01d33cd2623e7cdfe458dcc03066f0b4c455a3 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 21 May 2015 17:29:13 +0200 Subject: [PATCH 4/7] try to locate zlib valgrind problem on the travis boxen. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=577135 use set -e to terminate when any part of the build fails --- .travis.yml | 2 +- s/travis-build | 50 ++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 41 insertions(+), 11 deletions(-) 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 From 090197866b12bccfd2b27dd4ba469fded84e021b Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 21 May 2015 17:44:36 +0200 Subject: [PATCH 5/7] investigating travis build environment --- s/runtests | 11 +++++++---- s/travis-build | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/s/runtests b/s/runtests index 82c49251e..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,11 +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 51a501c15..d1ab6b853 100755 --- a/s/travis-build +++ b/s/travis-build @@ -47,6 +47,8 @@ $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 From 08382187069ba32072d0c604bebf1f674df81cbe Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 21 May 2015 17:48:45 +0200 Subject: [PATCH 6/7] generate suppressions, fix valgrind exit code --- s/travis-build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s/travis-build b/s/travis-build index d1ab6b853..3cb32c857 100755 --- a/s/travis-build +++ b/s/travis-build @@ -25,7 +25,7 @@ make test_valgrind_report () { cd tests ln -sf ../scripts/config.lua -valgrind $BUILD/eressea/eressea -v0 -t184 ../scripts/reports.lua +valgrind --gen-suppressions=all --error-exitcode=1 $BUILD/eressea/eressea -v0 -t184 ../scripts/reports.lua } test_unittests() { From b7f6bea5694794c610f4afc2790a2f38e6b5f7d5 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 21 May 2015 18:03:24 +0200 Subject: [PATCH 7/7] suppress zlib bugs on Travix boxen --- s/travis-build | 2 +- tests/ubuntu-12_04.supp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 tests/ubuntu-12_04.supp diff --git a/s/travis-build b/s/travis-build index 3cb32c857..4724d04b0 100755 --- a/s/travis-build +++ b/s/travis-build @@ -25,7 +25,7 @@ make test_valgrind_report () { cd tests ln -sf ../scripts/config.lua -valgrind --gen-suppressions=all --error-exitcode=1 $BUILD/eressea/eressea -v0 -t184 ../scripts/reports.lua +valgrind --suppressions=ubuntu-12_04.supp --error-exitcode=1 $BUILD/eressea/eressea -v0 -t184 ../scripts/reports.lua } test_unittests() { 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 +}