Merge pull request #265 from ennorehling/feature/travis-valgrind-cr

integration tests, valgrind suppression file, etc.
This commit is contained in:
Enno Rehling 2015-08-05 18:27:36 +02:00
commit 9a615c2f26
4 changed files with 43 additions and 0 deletions

View File

@ -11,6 +11,7 @@ addons:
- libncurses5-dev - libncurses5-dev
- libsqlite3-dev - libsqlite3-dev
- libxml2-dev - libxml2-dev
- valgrind
os: os:
- linux - linux
- osx - osx

View File

@ -16,3 +16,5 @@ s/build
cd $ROOT cd $ROOT
inifile inifile
s/runtests s/runtests
cd tests
./write-reports.sh

Binary file not shown.

40
tests/write-reports.sh Executable file
View File

@ -0,0 +1,40 @@
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
set -e
cd $ROOT/tests
setup
cleanup
VALGRIND=`which valgrind`
SERVER=../Debug/eressea/eressea
if [ -n "$VALGRIND" ]; then
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
[ -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"
grep -q REGION reports/$CRFILE || quit 2 "CR did not contain any regions"
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