Merge pull request #1 from badgerman/feature-valgrind-test

Include valgrind check as part of the Travis build
This commit is contained in:
Enno Rehling 2015-05-21 18:58:09 +02:00
commit b8e87617f1
5 changed files with 80 additions and 20 deletions

View File

@ -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 zlib1g-dev libtolua-dev liblua5.1-dev libncurses5-dev libsqlite3-dev libxml2-dev valgrind
os:
- linux
- osx

View File

@ -1,4 +1,7 @@
#!/bin/bash
set -e
ROOT=$(pwd)
while [ ! -d $ROOT/.git ]; do
ROOT=$(dirname $ROOT)
@ -15,10 +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

View File

@ -1,18 +1,63 @@
#!/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="$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
$BUILD/iniparser/inifile eressea.ini add lua:paths lunit:scripts
fi
}
[ -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() {
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 --suppressions=ubuntu-12_04.supp --error-exitcode=1 $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 "* lsb_release:"
lsb_release -a
echo "* zlib1g-dev package:"
dpkg -l zlib1g-dev
echo
# build the code
[ -d $BUILD ] || mkdir $BUILD
build
test_unittests
test_server
test_valgrind_report
cleanup

View File

@ -1,4 +1,3 @@
[eressea]
base = .
report = reports
@ -13,7 +12,3 @@ install = ..
paths = lunit:scripts
maxnmrs = 20
rules = e2
[editor]
color = 1

16
tests/ubuntu-12_04.supp Normal file
View File

@ -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
}