From e06352a2427ed1ff06eca0c0a8d118895cf0ac7d Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 12 Jul 2015 04:44:56 +0200 Subject: [PATCH 1/6] iniparser master --- iniparser | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iniparser b/iniparser index f84066fb7..5b96eac07 160000 --- a/iniparser +++ b/iniparser @@ -1 +1 @@ -Subproject commit f84066fb7d3254bdd9e89694acc4c1c20d001eed +Subproject commit 5b96eac07a88a215c616b0ae90d9ae6e3ed179b1 From 93f7c16defe7e6ed80d0484891ed226e8a65b340 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 12 Jul 2015 04:46:53 +0200 Subject: [PATCH 2/6] new iniparser --- src/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 8b1c8d984..547e15548 100644 --- a/src/main.c +++ b/src/main.c @@ -80,13 +80,13 @@ static void load_inifile(dictionary * d) str = iniparser_getstring(d, "eressea:locales", "de,en"); make_locales(str); - if (global.inifile) iniparser_free(global.inifile); + if (global.inifile) iniparser_freedict(global.inifile); global.inifile = d; } static void parse_config(const char *filename) { - dictionary *d = iniparser_new(filename); + dictionary *d = iniparser_load(filename); if (d) { load_inifile(d); log_debug("reading from configuration file %s\n", filename); @@ -318,7 +318,7 @@ int main(int argc, char **argv) lua_done(L); log_close(); if (global.inifile) { - iniparser_free(global.inifile); + iniparser_freedict(global.inifile); } return 0; } From 76740192f87ad904552f3fd4a78eddc9f25f6b2e Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 5 Aug 2015 17:42:36 +0200 Subject: [PATCH 3/6] check that the CR contains reasonable entries --- s/travis-build | 2 ++ tests/write-reports.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100755 tests/write-reports.sh diff --git a/s/travis-build b/s/travis-build index ad2c8607b..14aff5358 100755 --- a/s/travis-build +++ b/s/travis-build @@ -16,3 +16,5 @@ s/build cd $ROOT inifile s/runtests +cd tests +./write-reports.sh diff --git a/tests/write-reports.sh b/tests/write-reports.sh new file mode 100755 index 000000000..ec120bca8 --- /dev/null +++ b/tests/write-reports.sh @@ -0,0 +1,29 @@ +cleanup () { +rm -rf reports score +} + +setup() { +ln -sf ../scripts/config.lua +} + +quit() { +test -n "$2" && echo $2 +exit $1 +} + +ROOT=`pwd` +while [ ! -d $ROOT/.git ]; do + ROOT=`dirname $ROOT` +done + +cd $ROOT/tests +setup +cleanup +valgrind ../Debug/eressea/eressea -t 184 ../scripts/reports.lua +[ -d reports ] || quit 4 "no reports directory created" +CRFILE=184-zvto.cr +grep -q FACTION reports/$CRFILE || quit 1 "CR did not contain any factions" +grep -q REGION reports/$CRFILE || quit 2 "CR did not contain any regions" +grep -q EINHEIT reports/$CRFILE || quit 3 "CR did not contain any units" +echo "integration tests: PASS" +cleanup From 75235a11fc470d0e337ef132534b4f5032b2be0a Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 5 Aug 2015 18:03:43 +0200 Subject: [PATCH 4/6] update test data to include ships and buildings --- tests/data/184.dat | Bin 7702 -> 7773 bytes tests/write-reports.sh | 7 +++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/data/184.dat b/tests/data/184.dat index 74d72258a256f2c8b3f00c0208058e83d1ff5d92..ffe368510a226707f8cc399f4618e898a433fd55 100644 GIT binary patch delta 142 zcmbPcbJvD5nvsEliGhKEaU(C<>ddb% s=udvnp~Mf=%fP|z806&Y8RE*|xS5N`nsc(dIN#*QtU{Zoh&FKm0K}^*@&Et; delta 83 zcmca>GtGuGnvsEli2(>Ua&G5lW?*2P{EJ(4vH+*{=1v|XPAvx3;)2ZNR94ok)bi9E mX4c%wqM{5Y=KRbY7M9}7oNQ+H%)I2(yy8@*&D%tma{vHZn-;17 diff --git a/tests/write-reports.sh b/tests/write-reports.sh index ec120bca8..8927ea693 100755 --- a/tests/write-reports.sh +++ b/tests/write-reports.sh @@ -22,8 +22,11 @@ cleanup valgrind ../Debug/eressea/eressea -t 184 ../scripts/reports.lua [ -d reports ] || quit 4 "no reports directory created" CRFILE=184-zvto.cr -grep -q FACTION reports/$CRFILE || quit 1 "CR did not contain any factions" +grep -q PARTEI reports/$CRFILE || quit 1 "CR did not contain any factions" grep -q REGION reports/$CRFILE || quit 2 "CR did not contain any regions" -grep -q EINHEIT reports/$CRFILE || quit 3 "CR did not contain any units" +grep -q SCHIFF reports/$CRFILE || quit 3 "CR did not contain any ships" +grep -q BURG reports/$CRFILE || quit 4 "CR did not contain any buildings" +grep -q EINHEIT reports/$CRFILE || quit 5 "CR did not contain any units" +grep -q GEGENSTAENDE reports/$CRFILE || quit 6 "CR did not contain any items" echo "integration tests: PASS" cleanup From 487aaede16aa3960817fb0a617660b8fcba9c733 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 5 Aug 2015 18:14:57 +0200 Subject: [PATCH 5/6] install valgrind (can we?) and check for it when runnign tests --- .travis.yml | 1 + tests/write-reports.sh | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index de62c2200..dd3f469ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ addons: - libncurses5-dev - libsqlite3-dev - libxml2-dev + - valgrind os: - linux - osx diff --git a/tests/write-reports.sh b/tests/write-reports.sh index 8927ea693..eb42663fe 100755 --- a/tests/write-reports.sh +++ b/tests/write-reports.sh @@ -19,7 +19,13 @@ done cd $ROOT/tests setup cleanup -valgrind ../Debug/eressea/eressea -t 184 ../scripts/reports.lua +VALGRIND=`which valgrind` +SERVER=../Debug/eressea/eressea +if [ -n "$VALGRIND" ]; then +SERVER="$VALGRIND $SERVER" +fi +echo "running $SERVER" +$SERVER -t 184 ../scripts/reports.lua [ -d reports ] || quit 4 "no reports directory created" CRFILE=184-zvto.cr grep -q PARTEI reports/$CRFILE || quit 1 "CR did not contain any factions" From 47ff4ca9dd9a34baf5aab4848839b98fc2d23819 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 5 Aug 2015 18:19:17 +0200 Subject: [PATCH 6/6] use suppression file for old ubuntu --- tests/write-reports.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/write-reports.sh b/tests/write-reports.sh index eb42663fe..775fdb622 100755 --- a/tests/write-reports.sh +++ b/tests/write-reports.sh @@ -16,13 +16,15 @@ while [ ! -d $ROOT/.git ]; do ROOT=`dirname $ROOT` done +set -e cd $ROOT/tests setup cleanup VALGRIND=`which valgrind` SERVER=../Debug/eressea/eressea if [ -n "$VALGRIND" ]; then -SERVER="$VALGRIND $SERVER" +SUPP=../share/ubuntu-12_04.supp +SERVER="$VALGRIND --suppressions=$SUPP --error-exitcode=1 --leak-check=no $SERVER" fi echo "running $SERVER" $SERVER -t 184 ../scripts/reports.lua