[glib/wip/gcleanup: 52/106] glib: Define cleanup lists for glib tests



commit 97d736c568bd98fc6d6131e4d6a9e774f41a4405
Author: Stef Walter <stefw gnome org>
Date:   Sat Nov 9 23:39:30 2013 +0100

    glib: Define cleanup lists for glib tests
    
    This allows G_CLEANUP to be used in the tests, and from things
    like G_PRIVATE_INIT and so on.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711744

 glib/tests/Makefile.am |    2 +-
 glib/tests/private.c   |    2 ++
 tests/Makefile.am      |    2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/glib/tests/Makefile.am b/glib/tests/Makefile.am
index eaa99ae..cdd298b 100644
--- a/glib/tests/Makefile.am
+++ b/glib/tests/Makefile.am
@@ -2,7 +2,7 @@ include $(top_srcdir)/glib-tap.mk
 
 LDADD = $(top_builddir)/glib/libglib-2.0.la -lm
 AM_CPPFLAGS = -g $(glib_INCLUDES) $(GLIB_DEBUG_FLAGS)
-DEFS = -DG_LOG_DOMAIN=\"GLib\" -DEXEEXT=\"$(EXEEXT)\"
+DEFS = -DG_LOG_DOMAIN=\"GLib\" -DEXEEXT=\"$(EXEEXT)\" -DG_CLEANUP_SCOPE=tests_cleanup
 AM_CFLAGS = $(GLIB_WARN_CFLAGS)
 
 # These tests corrupt the gcov bookkeeping, so we
diff --git a/glib/tests/private.c b/glib/tests/private.c
index d23259c..8f4ca2e 100644
--- a/glib/tests/private.c
+++ b/glib/tests/private.c
@@ -370,6 +370,8 @@ test_static_private5 (void)
     g_thread_join (thread[i]);
 }
 
+G_CLEANUP_DEFINE
+
 int
 main (int argc, char *argv[])
 {
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b6b3ebd..45828cf 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -4,7 +4,7 @@ SUBDIRS = gobject refcount
 
 LDADD = $(top_builddir)/glib/libglib-2.0.la
 AM_CPPFLAGS = $(gmodule_INCLUDES) $(GLIB_DEBUG_FLAGS)
-DEFS = -DGLIB_DISABLE_DEPRECATION_WARNINGS -DG_LOG_DOMAIN=\"GLib\"
+DEFS = -DGLIB_DISABLE_DEPRECATION_WARNINGS -DG_LOG_DOMAIN=\"GLib\" -DG_CLEANUP_SCOPE=tests_cleanup
 AM_CFLAGS = -g
 
 # Some random programs that appear not to be testcases and not used from any testcases


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