mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-11-01 21:13:12 +01:00
Added memory checking for travis-ci cmake build.
This commit is contained in:
@@ -9,6 +9,7 @@ before_install:
|
||||
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get update
|
||||
- sudo apt-get install valgrind
|
||||
- sudo apt-get install libgtest-dev
|
||||
- "cd /usr/src/gtest && sudo cmake . && sudo cmake --build . && sudo mv libg* /usr/local/lib/ ; cd -"
|
||||
install:
|
||||
|
||||
@@ -158,6 +158,9 @@ SET_TARGET_PROPERTIES (msgpack PROPERTIES SOVERSION 3 VERSION 4.0.0)
|
||||
|
||||
IF (MSGPACK_BUILD_TESTS)
|
||||
ENABLE_TESTING ()
|
||||
SET(CTEST_MEMORYCHECK_COMMAND "/usr/bin/valgrind")
|
||||
INCLUDE(Dart)
|
||||
SET(MEMORYCHECK_COMMAND_OPTIONS "--leak-check=full --error-exitcode=1")
|
||||
ADD_SUBDIRECTORY (test)
|
||||
ENDIF ()
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
mkdir build
|
||||
|
||||
@@ -53,4 +53,20 @@ then
|
||||
exit $ret
|
||||
fi
|
||||
|
||||
ctest -T memcheck | tee memcheck.log
|
||||
|
||||
ret=${PIPESTATUS[0]}
|
||||
if [ $ret -ne 0 ]
|
||||
then
|
||||
exit $ret
|
||||
fi
|
||||
|
||||
cat memcheck.log | grep "Memory Leak" > /dev/null
|
||||
|
||||
ret=$?
|
||||
if [ $ret -eq 0 ]
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user