.travis.yml: add a travis build entry to run tests under valgrind

Makefile.am: add valgrind to the AM_TESTS_ENVIRONMENT
configure.ac: enable valgrind testing option for ./configure
m4/valgrind-tests.m4: enable tracing children for libtool wrapper
script compatibility, but ignore standard binaries in /usr or /bin
This commit is contained in:
Ilya Lipnitskiy 2013-12-03 10:26:51 -08:00
parent 2b371c154f
commit baa3ab296d
4 changed files with 8 additions and 1 deletions

View File

@ -9,3 +9,5 @@ install:
script: script:
- ./autogen.sh - ./autogen.sh
- ./configure && make distcheck && make clean - ./configure && make distcheck && make clean
- ./configure --enable-valgrind-tests && make distcheck
DISTCHECK_CONFIGURE_FLAGS="--enable-valgrind-tests" && make clean

View File

@ -92,6 +92,8 @@ protoc_c_protoc_c_LDADD = \
# protobuf-c tests # protobuf-c tests
# #
AM_TESTS_ENVIRONMENT = $(VALGRIND)
check_PROGRAMS += \ check_PROGRAMS += \
t/generated-code/test-generated-code \ t/generated-code/test-generated-code \
t/generated-code2/test-generated-code2 t/generated-code2/test-generated-code2

View File

@ -41,6 +41,8 @@ else
fi fi
AM_CONDITIONAL([BUILD_COMPILER], [test "x$enable_protoc" != "xno"]) AM_CONDITIONAL([BUILD_COMPILER], [test "x$enable_protoc" != "xno"])
gl_VALGRIND_TESTS
AC_C_BIGENDIAN AC_C_BIGENDIAN
AC_OUTPUT AC_OUTPUT

View File

@ -23,7 +23,8 @@ AC_DEFUN([gl_VALGRIND_TESTS],
if test -n "$VALGRIND" && $VALGRIND -q true > /dev/null 2>&1; then if test -n "$VALGRIND" && $VALGRIND -q true > /dev/null 2>&1; then
opt_valgrind_tests=yes opt_valgrind_tests=yes
VALGRIND="$VALGRIND -q --error-exitcode=1 --leak-check=full" VALGRIND="$VALGRIND -q --error-exitcode=1 --leak-check=full \
--trace-children=yes --trace-children-skip=/usr/*,/bin/*"
else else
opt_valgrind_tests=no opt_valgrind_tests=no
VALGRIND= VALGRIND=