From 88f454e1f746ef60ded1ccdb51a16ded8b374f06 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 21 May 2015 08:27:07 +0200 Subject: [PATCH 01/10] failed tests abort runtests and return an error code small test world for (future) valgrind tests. --- s/runtests | 6 +++--- scripts/run-tests-e2.lua | 2 +- scripts/run-tests-e3.lua | 2 +- scripts/run-tests.lua | 2 +- tests/data/184.dat | Bin 0 -> 7702 bytes tests/eressea.ini | 19 +++++++++++++++++++ tests/orders.184 | 0 7 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 tests/data/184.dat create mode 100644 tests/eressea.ini create mode 100644 tests/orders.184 diff --git a/s/runtests b/s/runtests index ef7fc71df..4495d5ed0 100755 --- a/s/runtests +++ b/s/runtests @@ -18,7 +18,7 @@ fi $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 -$ROOT/$BIN_DIR/eressea/eressea -v0 scripts/run-tests-e2.lua -$ROOT/$BIN_DIR/eressea/eressea -v0 scripts/run-tests-e3.lua +$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/scripts/run-tests-e2.lua b/scripts/run-tests-e2.lua index 9f08b0f54..4a2b3e59e 100644 --- a/scripts/run-tests-e2.lua +++ b/scripts/run-tests-e2.lua @@ -19,4 +19,4 @@ require 'lunit' rules = require('eressea.' .. config.rules) result = lunit.main() -return result.errors +return result.errors + result.failed diff --git a/scripts/run-tests-e3.lua b/scripts/run-tests-e3.lua index 2f823daa7..47bcca60b 100644 --- a/scripts/run-tests-e3.lua +++ b/scripts/run-tests-e3.lua @@ -20,4 +20,4 @@ require 'lunit' eressea.settings.set("rules.alliances", "0") rules = require('eressea.' .. config.rules) result = lunit.main() -return result.errors +return result.errors + result.failed diff --git a/scripts/run-tests.lua b/scripts/run-tests.lua index d13a1425b..d1306ddcd 100644 --- a/scripts/run-tests.lua +++ b/scripts/run-tests.lua @@ -14,4 +14,4 @@ require 'eressea.path' require 'tests' require 'lunit' result = lunit.main() -return result.errors +return result.errors + result.failed diff --git a/tests/data/184.dat b/tests/data/184.dat new file mode 100644 index 0000000000000000000000000000000000000000..74d72258a256f2c8b3f00c0208058e83d1ff5d92 GIT binary patch literal 7702 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 literal 0 HcmV?d00001 diff --git a/tests/eressea.ini b/tests/eressea.ini new file mode 100644 index 000000000..9f324fe71 --- /dev/null +++ b/tests/eressea.ini @@ -0,0 +1,19 @@ + +[eressea] +base = . +report = reports +verbose = 0 +lomem = 0 +debug = 0 +memcheck = 0 +locales = de,en + +[lua] +install = .. +paths = lunit:scripts +maxnmrs = 20 +rules = e2 + +[editor] +color = 1 + diff --git a/tests/orders.184 b/tests/orders.184 new file mode 100644 index 000000000..e69de29bb From 1c4778e3efa015babbaca4a31e85431d64e6ab61 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 21 May 2015 11:05:24 +0200 Subject: [PATCH 02/10] abort tests when non-zero exit-code is returned, fix GiveRestriction for pool tests --- s/runtests | 2 +- scripts/tests/pool.lua | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/s/runtests b/s/runtests index 4495d5ed0..7aea152b5 100755 --- a/s/runtests +++ b/s/runtests @@ -15,7 +15,7 @@ if [ ! -d $ROOT/$BIN_DIR ]; then exit fi -$ROOT/$BIN_DIR/eressea/test_eressea +$ROOT/$BIN_DIR/eressea/test_eressea || exit $? cd $ROOT [ -e eressea.ini ] || ln -sf conf/eressea.ini $ROOT/$BIN_DIR/eressea/eressea -v0 scripts/run-tests.lua || exit $? diff --git a/scripts/tests/pool.lua b/scripts/tests/pool.lua index 2ac9c87f2..b89d180fa 100644 --- a/scripts/tests/pool.lua +++ b/scripts/tests/pool.lua @@ -8,6 +8,7 @@ function setup() eressea.settings.set("rules.economy.food", "0") eressea.settings.set("nmr.removenewbie", "0") eressea.settings.set("nmr.timeout", "0") + eressea.settings.set("GiveRestriction", "0") eressea.settings.set("rules.magic.playerschools", "") conf = [[{ "races": { From cf8828059504310be8a4c0b64b2dcdc9dafb06b8 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 21 May 2015 11:52:31 +0200 Subject: [PATCH 03/10] fix build_building tests, require an order argument. test current replace_order behavior. --- src/kernel/build.test.c | 9 ++++++--- src/kernel/order.c | 3 +++ src/kernel/order.test.c | 16 ++++++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/kernel/build.test.c b/src/kernel/build.test.c index 3ee3cf056..2befe6733 100644 --- a/src/kernel/build.test.c +++ b/src/kernel/build.test.c @@ -204,7 +204,8 @@ static void test_build_building_no_materials(CuTest *tc) { btype = bt_find("castle"); assert(btype); set_level(u, SK_BUILDING, 1); - CuAssertIntEquals(tc, ENOMATERIALS, build_building(u, btype, 0, 4, 0)); + u->orders = create_order(K_MAKE, u->faction->locale, 0); + CuAssertIntEquals(tc, ENOMATERIALS, build_building(u, btype, 0, 4, u->orders)); CuAssertPtrEquals(tc, 0, u->region->buildings); CuAssertPtrEquals(tc, 0, u->building); test_cleanup(); @@ -222,7 +223,8 @@ static void test_build_building_with_golem(CuTest *tc) { assert(btype->construction); set_level(bf.u, SK_BUILDING, 1); - CuAssertIntEquals(tc, 1, build_building(u, btype, 0, 1, 0)); + u->orders = create_order(K_MAKE, u->faction->locale, 0); + CuAssertIntEquals(tc, 1, build_building(u, btype, 0, 1, u->orders)); CuAssertPtrNotNull(tc, u->region->buildings); CuAssertIntEquals(tc, 1, u->region->buildings->size); CuAssertIntEquals(tc, 0, u->number); @@ -245,7 +247,8 @@ static void test_build_building_success(CuTest *tc) { i_change(&bf.u->items, rtype->itype, 1); set_level(u, SK_BUILDING, 1); - CuAssertIntEquals(tc, 1, build_building(u, btype, 0, 4, 0)); + u->orders = create_order(K_MAKE, u->faction->locale, 0); + CuAssertIntEquals(tc, 1, build_building(u, btype, 0, 4, u->orders)); CuAssertPtrNotNull(tc, u->region->buildings); CuAssertPtrEquals(tc, u->region->buildings, u->building); CuAssertIntEquals(tc, 1, u->building->size); diff --git a/src/kernel/order.c b/src/kernel/order.c index b72b8e6bd..20cce5853 100644 --- a/src/kernel/order.c +++ b/src/kernel/order.c @@ -65,6 +65,9 @@ static void release_data(order_data * data) void replace_order(order ** dlist, order * orig, const order * src) { + assert(src); + assert(orig); + assert(dlist); while (*dlist != NULL) { order *dst = *dlist; if (dst->data == orig->data) { diff --git a/src/kernel/order.test.c b/src/kernel/order.test.c index 414dd87e7..6900da420 100644 --- a/src/kernel/order.test.c +++ b/src/kernel/order.test.c @@ -143,6 +143,21 @@ static void test_skip_token(CuTest *tc) { CuAssertStrEquals(tc, 0, getstrtoken()); } +static void test_replace_order(CuTest *tc) { + order *orders = 0, *orig, *repl; + struct locale * lang = get_or_create_locale("en"); + + orig = create_order(K_MAKE, lang, 0); + repl = create_order(K_ALLY, lang, 0); + replace_order(&orders, orig, repl); + CuAssertPtrEquals(tc, 0, orders); + orders = orig; + replace_order(&orders, orig, repl); + CuAssertPtrNotNull(tc, orders); + CuAssertPtrEquals(tc, 0, orders->next); + CuAssertIntEquals(tc, getkeyword(repl), getkeyword(orders)); +} + CuSuite *get_order_suite(void) { CuSuite *suite = CuSuiteNew(); @@ -152,6 +167,7 @@ CuSuite *get_order_suite(void) SUITE_ADD_TEST(suite, test_parse_make_temp); SUITE_ADD_TEST(suite, test_parse_maketemp); SUITE_ADD_TEST(suite, test_init_order); + SUITE_ADD_TEST(suite, test_replace_order); SUITE_ADD_TEST(suite, test_skip_token); SUITE_ADD_TEST(suite, test_getstrtoken); return suite; From 5c62bf2401a55d999f5ae1d52310751db446828d Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 21 May 2015 13:18:52 +0200 Subject: [PATCH 04/10] 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 05/10] 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 06/10] 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 07/10] 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 08/10] 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 09/10] 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 10/10] 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 +}