From b772c5a5d68f45f61eca1d2b72fdd611385c3e36 Mon Sep 17 00:00:00 2001 From: Bob Friesenhahn Date: Sun, 23 Aug 2009 23:23:19 +0000 Subject: [PATCH] Export certain variables (MAKE, MAKEFLAGS, MEMCHECK) to tests and added 'memcheck' and 'ptrcheck' targets to make it easy to run the tests under valgrind. --- ChangeLog | 4 ++++ test/Makefile.am | 14 ++++++++++++++ test/Makefile.in | 15 +++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/ChangeLog b/ChangeLog index 392a66f4..f446125f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,10 @@ tiffcrop.sh into a collection of many specific tests. Re-wrote all of the existing tests to be based on some simple shell functions. Make distcheck works again. + + Export certain variables (MAKE, MAKEFLAGS, MEMCHECK) to tests and + added 'memcheck' and 'ptrcheck' targets to make it easy to run the + tests under valgrind. 2009-08-21 Bob Friesenhahn diff --git a/test/Makefile.am b/test/Makefile.am index f1205cfc..5e7b2236 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -27,6 +27,12 @@ AUTOMAKE_OPTIONS = 1.11 color-tests parallel-tests foreign LIBTIFF = $(top_builddir)/libtiff/libtiff.la +# Environment parameters to be used during tests +TESTS_ENVIRONMENT = \ + MAKE="$(MAKE)" \ + MAKEFLAGS="$(MAKEFLAGS)" \ + MEMCHECK="$(MEMCHECK)" + EXTRA_DIST = \ $(TESTSCRIPTS) \ $(IMAGES_EXTRA_DIST) \ @@ -155,6 +161,14 @@ rewrite_LDADD = $(LIBTIFF) INCLUDES = -I$(top_srcdir)/libtiff +# memcheck: valgrind's memory access checker +memcheck: + $(MAKE) MEMCHECK='valgrind --tool=memcheck --leak-check=full --read-var-info=yes --track-origins=yes --num-callers=12 --quiet $(VALGRIND_EXTRA_OPTS)' check + +# ptrcheck: valgrind's experimental pointer checking tool. +ptrcheck: + $(MAKE) MEMCHECK='valgrind --tool=exp-ptrcheck --quiet $(VALGRIND_EXTRA_OPTS)' check + generate-tiff2rgba-tests: for file in $(TIFFIMAGES) ; \ do \ diff --git a/test/Makefile.in b/test/Makefile.in index 1fa5cde7..ea637540 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -365,6 +365,13 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.11 color-tests parallel-tests foreign LIBTIFF = $(top_builddir)/libtiff/libtiff.la + +# Environment parameters to be used during tests +TESTS_ENVIRONMENT = \ + MAKE="$(MAKE)" \ + MAKEFLAGS="$(MAKEFLAGS)" \ + MEMCHECK="$(MEMCHECK)" + EXTRA_DIST = \ $(TESTSCRIPTS) \ $(IMAGES_EXTRA_DIST) \ @@ -1102,6 +1109,14 @@ uninstall-am: recheck recheck-html tags uninstall uninstall-am +# memcheck: valgrind's memory access checker +memcheck: + $(MAKE) MEMCHECK='valgrind --tool=memcheck --leak-check=full --read-var-info=yes --track-origins=yes --num-callers=12 --quiet $(VALGRIND_EXTRA_OPTS)' check + +# ptrcheck: valgrind's experimental pointer checking tool. +ptrcheck: + $(MAKE) MEMCHECK='valgrind --tool=exp-ptrcheck --quiet $(VALGRIND_EXTRA_OPTS)' check + generate-tiff2rgba-tests: for file in $(TIFFIMAGES) ; \ do \