Valgrind will be run with CUNIT_VALGRIND_FLAGS when
CUNIT_WITH_VALGRIND is set to YES.
Also update the Travis configuration to use valgrind.
Closes #4219
Closes https://github.com/postgis/postgis/pull/323
git-svn-id: http://svn.osgeo.org/postgis/trunk@16962
b70326c6-7e19-0410-871a-
916f4a2858ee
CFLAGS_COV="-g -O0 --coverage"
LDFLAGS_COV="--coverage"
+export CUNIT_WITH_VALGRIND=YES
+export CUNIT_VALGRIND_FLAGS="--leak-check=full --error-exitcode=1"
+
/usr/local/pgsql/bin/pg_ctl -c -l /tmp/logfile start
./autogen.sh
CFLAGS=@WARNFLAGS@ @CFLAGS@ @GEOS_CPPFLAGS@ @PROJ_CPPFLAGS@ $(CUNIT_CPPFLAGS)
LDFLAGS = @GEOS_LDFLAGS@ -lgeos_c $(CUNIT_LDFLAGS) -lm
+ifeq ($(CUNIT_WITH_VALGRIND), YES)
+ LIBTOOL_VALGRIND := valgrind $(CUNIT_VALGRIND_FLAGS)
+endif
+
# ADD YOUR NEW TEST FILE HERE (1/1)
OBJS= \
cu_algorithm.o \
# Build and run the unit tester
check: cu_tester
- @./cu_tester
+ $(LIBTOOL) --mode=execute $(LIBTOOL_VALGRIND) ./cu_tester
endif