[glib/wip/gcleanup: 26/79] glib: Define cleanup lists for glib tests
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/gcleanup: 26/79] glib: Define cleanup lists for glib tests
- Date: Sun, 10 Nov 2013 15:21:42 +0000 (UTC)
commit 3f02856e77e6f8a51394af9eb6b24f1f12db5e9b
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 1bdcffa..c647719 100644
--- a/glib/tests/private.c
+++ b/glib/tests/private.c
@@ -377,6 +377,8 @@ test_static_private5 (void)
g_cond_clear (&c5b);
}
+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]