[folks] build: Rewrite valgrind.mk to use GNU Make conditionals



commit e3458da97be361570872f591b42e8bc51e847374
Author: Philip Withnall <philip tecnocode co uk>
Date:   Thu Jan 3 11:04:11 2013 +0000

    build: Rewrite valgrind.mk to use GNU Make conditionals
    
    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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]