+include $(top_srcdir)/build/Makefile.decl
+
WEBHOST = anarchy.freedesktop.org
WEBBASE = /srv/p11-glue.freedesktop.org/www
libcutest_la_SOURCES = \
cutest/CuTest.c \
cutest/CuTest.h
+
+memcheck:
+
+leakcheck:
--- /dev/null
+NULL =
+
+memcheck:
+ @for dir in $(SUBDIRS); do \
+ test "$$dir" = "." || $(MAKE) -C $$dir memcheck; \
+ done
+
+leakcheck:
+ @for dir in $(SUBDIRS); do \
+ test "$$dir" = "." || $(MAKE) -C $$dir leakcheck; \
+ done
+NULL =
CUTEST_CFLAGS = \
-I$(top_srcdir)/build/cutest \
-DP11_KIT_FUTURE_UNSTABLE_API
CUTEST_LIBS = $(top_builddir)/build/libcutest.la
+
+MEMCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=80 --quiet --trace-children=yes
+
+LEAKCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=81 --quiet --leak-check=yes
+
+memcheck: all
+ make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(MEMCHECK_ENV)" check-TESTS
+
+leakcheck: all
+ make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(LEAKCHECK_ENV)" check-TESTS
-NULL =
+
+include $(top_srcdir)/build/Makefile.decl
SUBDIRS = . tests
include $(top_srcdir)/build/Makefile.tests
-NULL =
-
COMMON = $(top_srcdir)/common
INCLUDES = \
SUBDIRS = manual
+
+memcheck:
+
+leakcheck:
the tests. If you run it from a subdirectory only the tests in that
directory will be run.</para>
+ <para>To check for memory errors or memory leaks, run <literal>make memcheck</literal>
+ or <literal>make leakcheck</literal> respectively. This requires valgrind
+ be installed.</para>
+
<para>Build p11-kit with the <option>--enable-coverage</option> configure
option to build code coverage support.</para>
-NULL =
+
+include $(top_srcdir)/build/Makefile.decl
SUBDIRS = . tests
-NULL =
+
+include $(top_srcdir)/build/Makefile.decl
SUBDIRS = . tests
include $(top_srcdir)/build/Makefile.tests
-NULL =
-
EXTRA_DIST = files
if WITH_ASN1
COMMON = $(top_srcdir)/common
TOOLS = $(top_srcdir)/tools
+TEST_RUNNER = libtool --mode=execute
+
INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/p11-kit \
-NULL =
+
+include $(top_srcdir)/build/Makefile.decl
SUBDIRS = . tests
include $(top_srcdir)/build/Makefile.tests
-NULL =
-
INCLUDES = \
-I$(top_srcdir) \
-I$(srcdir)/.. \