Add test reporting to travis script

This commit is contained in:
Thiago de Arruda
2014-02-26 21:33:39 -03:00
parent 42a9654fae
commit a97c1754ad
3 changed files with 16 additions and 5 deletions

View File

@@ -3,5 +3,18 @@
export VALGRIND_CHECK=1
make cmake CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$PWD/dist"
make
make test > /dev/null 2>&1
echo "Running tests with valgrind..."
if ! make test > /dev/null 2>&1; then
failed=$(ls src/testdir/valgrind.*)
if [ -n "$failed" ]; then
echo "Memory leak detected" >&2
cat src/testdir/valgrind.*
else
echo "Failed tests:" >&2
for t in src/testdir/*.failed; do
echo ${t%%.*}
done
fi
exit 2
fi
make install