From 9878ce05e75421820115b8eaaf3752ab4bd06e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Mon, 6 Mar 2017 20:34:02 +0100 Subject: CI: Add memleak checking using valgrind (#5350) Add a new step to check memleaks on our current unit tests suite --- util/travis/script.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'util/travis/script.sh') diff --git a/util/travis/script.sh b/util/travis/script.sh index 24a74d186..84ea578a5 100755 --- a/util/travis/script.sh +++ b/util/travis/script.sh @@ -24,8 +24,15 @@ if [[ $PLATFORM == "Unix" ]]; then -DBUILD_SERVER=TRUE \ $CMAKE_FLAGS .. make -j2 + echo "Running unit tests." - ../bin/minetest --run-unittests && exit 0 + CMD="../bin/minetest --run-unittests" + if [[ "$VALGRIND" == "1" ]]; then + valgrind --leak-check=full --leak-check-heuristics=all --undef-value-errors=no --error-exitcode=9 ${CMD} && exit 0 + else + ${CMD} && exit 0 + fi + elif [[ $PLATFORM == Win* ]]; then [[ $CC == "clang" ]] && exit 1 # Not supposed to happen # We need to have our build directory outside of the minetest directory because -- cgit v1.2.3