From 76740192f87ad904552f3fd4a78eddc9f25f6b2e Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 5 Aug 2015 17:42:36 +0200 Subject: [PATCH] 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