From e3458da97be361570872f591b42e8bc51e847374 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 3 Jan 2013 11:04:11 +0000 Subject: [PATCH] build: Rewrite valgrind.mk to use GNU Make conditionals MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This means we’re not overwriting rules and potentially changing their prerequisites. Incorrectly overwriting check-* rules was causing tests to be run twice in the tests/folks directory. See: https://bugzilla.gnome.org/show_bug.cgi?id=690990 --- NEWS | 1 + valgrind.mk | 33 +++++++++++++++------------------ 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/NEWS b/NEWS index e30233d..e4e0366 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ Bugs fixed: • Bug 685992 — empathy strips the "+" (plus) from the numbers from the gnome-contacts • Bug 690989 — "warning: copying delegates is discouraged" +• Bug 690990 — Add tests/README API changes: • Add Backend.enable_persona_store and disable_persona_store. diff --git a/valgrind.mk b/valgrind.mk index e1a0a7f..7876046 100644 --- a/valgrind.mk +++ b/valgrind.mk @@ -1,18 +1,15 @@ -check: $(BUILT_SOURCES) - if test -n "$$FOLKS_TEST_VALGRIND"; then \ - G_DEBUG=${G_DEBUG:+"${G_DEBUG},"}gc-friendly; \ - G_SLICE=${G_SLICE},always-malloc; \ - $(MAKE) $(AM_MAKEFLAGS) \ - TESTS_ENVIRONMENT="$(TESTS_ENVIRONMENT) \ - libtool --mode=execute valgrind \ - --leak-check=full \ - --show-reachable=no \ - --gen-suppressions=all \ - --num-callers=20 \ - --error-exitcode=0 \ - --log-file=valgrind.log.%p" \ - check-am; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) check-am; \ - fi - +# Pass FOLKS_TEST_VALGRIND=1 to make to enable Valgrind on the tests +# This file must be included _after_ TESTS_ENVIRONMENT has been set by the Makefile.am. +ifeq ($(FOLKS_TEST_VALGRIND),1) +TESTS_ENVIRONMENT := \ + G_DEBUG=$(G_DEBUG),gc-friendly \ + G_SLICE=$(G_SLICE),always-malloc \ + $(TESTS_ENVIRONMENT) \ + $(LIBTOOL) --mode=execute valgrind \ + --leak-check=full \ + --show-reachable=no \ + --gen-suppressions=all \ + --num-callers=20 \ + --error-exitcode=0 \ + --log-file=valgrind.log.%p +endif -- 2.7.4