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
This commit is contained in:
Stef Walter
2013-11-09 23:39:30 +01:00
parent 530f4930bf
commit 75a458a9b4
3 changed files with 4 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ include $(top_srcdir)/glib-tap.mk
LDADD = $(top_builddir)/glib/libglib-2.0.la -lm LDADD = $(top_builddir)/glib/libglib-2.0.la -lm
AM_CPPFLAGS = -g $(glib_INCLUDES) $(GLIB_DEBUG_FLAGS) 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) AM_CFLAGS = $(GLIB_WARN_CFLAGS)
# These tests corrupt the gcov bookkeeping, so we # These tests corrupt the gcov bookkeeping, so we

View File

@@ -370,6 +370,8 @@ test_static_private5 (void)
g_thread_join (thread[i]); g_thread_join (thread[i]);
} }
G_CLEANUP_DEFINE
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {

View File

@@ -4,7 +4,7 @@ SUBDIRS = gobject refcount
LDADD = $(top_builddir)/glib/libglib-2.0.la LDADD = $(top_builddir)/glib/libglib-2.0.la
AM_CPPFLAGS = $(gmodule_INCLUDES) $(GLIB_DEBUG_FLAGS) 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 AM_CFLAGS = -g
# Some random programs that appear not to be testcases and not used from any testcases # Some random programs that appear not to be testcases and not used from any testcases