dde282234a770bddc47463af5ca64fbbf3cca2cf
diff --git a/Makefile.decl b/Makefile.decl
index cbc0da1..f91a84e 100644
--- a/Makefile.decl
+++ b/Makefile.decl
@@ -56,6 +56,28 @@ test-report perf-report full-report:	${TEST_PROGS}
 	    rm -rf "$$GTESTER_LOGDIR"/ ; \
 	    ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \
 	  }
-.PHONY: test test-report perf-report full-report
+
+test-massif:  ${TEST_PROGS}
+	@test -z "${TEST_PROGS}" || for test in ${TEST_PROGS} ; do \
+	   G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1 \
+	   libtool --mode=execute valgrind --tool=massif --massif-out-file=$$test-massif.log ./$$test && \
+	   ms_print $$test-massif.log --threshold=5 ${MASSIF_ARGS} > $$test-massif.output; \
+	  done
+	@ for subdir in $(SUBDIRS) . ; do \
+	    test "$$subdir" = "." -o "$$subdir" = "po" || \
+	    ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
+	  done
+
+test-memcheck:  ${TEST_PROGS}
+	@test -z "${TEST_PROGS}" || for test in ${TEST_PROGS} ; do \
+	   G_SLICE=always-malloc G_DEBUG=gc-friendly GLIBCPP_FORCE_NEW=1 GLIBCXX_FORCE_NEW=1 \
+	   libtool --mode=execute valgrind --tool=memcheck ${MEMCHECK_ARGS} ./$$test ; \
+	  done
+	@ for subdir in $(SUBDIRS) . ; do \
+	    test "$$subdir" = "." -o "$$subdir" = "po" || \
+	    ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
+	  done
+
+.PHONY: test test-report perf-report full-report test-massif test-valgrind
 # run make test as part of make check
 check-local: test
