[glib/wip/gcleanup] gcleanup: Define cleanup lists for modules and tests



commit b6884cb04accd6c90b52b4c88cdd4684ba2a6735
Author: Stef Walter <stefw gnome org>
Date:   Thu Nov 7 22:35:06 2013 +0100

    gcleanup: Define cleanup lists for modules and tests

 gio/Makefile.am              |    2 ++
 gio/gio.c                    |   28 ++++++++++++++++++++++++++++
 glib/tests/private.c         |    3 +++
 gmodule/Makefile.am          |    1 +
 gmodule/gmodule.c            |    2 ++
 gobject/Makefile.am          |    1 +
 gobject/gobject.c            |    1 +
 gobject/tests/Makefile.am    |    2 +-
 gobject/tests/binding.c      |    2 ++
 gobject/tests/boxed.c        |    2 ++
 gobject/tests/dynamictests.c |    2 ++
 gobject/tests/enums.c        |    2 ++
 gobject/tests/object.c       |    2 ++
 gobject/tests/param.c        |    4 ++++
 gobject/tests/private.c      |    2 ++
 gobject/tests/properties.c   |    2 ++
 gobject/tests/reference.c    |    2 ++
 gobject/tests/signals.c      |    2 ++
 gobject/tests/testcommon.h   |    3 +++
 gobject/tests/threadtests.c  |    2 ++
 gobject/tests/type.c         |    2 ++
 21 files changed, 68 insertions(+), 1 deletions(-)
---
diff --git a/gio/Makefile.am b/gio/Makefile.am
index ff3bc8a..77801fd 100644
--- a/gio/Makefile.am
+++ b/gio/Makefile.am
@@ -23,6 +23,7 @@ uninstall-ms-lib:
 
 AM_CPPFLAGS = \
        -DG_LOG_DOMAIN=\"GLib-GIO\"                     \
+       -DG_CLEANUP_MODULE=gio                          \
        $(gmodule_INCLUDES)                             \
        $(GLIB_DEBUG_FLAGS)                             \
        -DGIO_COMPILATION                               \
@@ -337,6 +338,7 @@ giowin32include_HEADERS = \
 endif
 
 libgio_2_0_la_SOURCES =                \
+       gio.c                   \
        gappinfo.c              \
        gasynchelper.c          \
        gasynchelper.h          \
diff --git a/gio/gio.c b/gio/gio.c
new file mode 100644
index 0000000..fbab6bb
--- /dev/null
+++ b/gio/gio.c
@@ -0,0 +1,28 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright (C) 2013 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Stef Walter <stefw redhat com>
+ */
+
+#include "config.h"
+
+#include <glib/glib.h>
+
+/* The cleanup list for libgio */
+G_CLEANUP_DEFINE
diff --git a/glib/tests/private.c b/glib/tests/private.c
index 7ebfd67..52bc38b 100644
--- a/glib/tests/private.c
+++ b/glib/tests/private.c
@@ -22,6 +22,7 @@
 
 /* We are testing some deprecated APIs here */
 #define GLIB_DISABLE_DEPRECATION_WARNINGS
+#define G_CLEANUP_MODULE tests
 
 #include <glib.h>
 
@@ -375,6 +376,8 @@ test_static_private5 (void)
   g_cond_clear (&c5b);
 }
 
+G_CLEANUP_DEFINE
+
 int
 main (int argc, char *argv[])
 {
diff --git a/gmodule/Makefile.am b/gmodule/Makefile.am
index 6acd846..9727aa9 100644
--- a/gmodule/Makefile.am
+++ b/gmodule/Makefile.am
@@ -4,6 +4,7 @@ include $(top_srcdir)/glib.mk
 AM_CPPFLAGS =                          \
        $(glib_INCLUDES)                \
        -DG_LOG_DOMAIN=\"GModule\"      \
+       -DG_CLEANUP_MODULE=gmodule      \
        @GLIB_DEBUG_FLAGS@              \
        -DG_DISABLE_DEPRECATED
 
diff --git a/gmodule/gmodule.c b/gmodule/gmodule.c
index ebeacef..13cf4c7 100644
--- a/gmodule/gmodule.c
+++ b/gmodule/gmodule.c
@@ -48,6 +48,8 @@
 #include "gmoduleconf.h"
 #include "gstdio.h"
 
+G_CLEANUP_DEFINE
+
 /**
  * SECTION:modules
  * @title: Dynamic Loading of Modules
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index 1509616..d9bece1 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -8,6 +8,7 @@ SUBDIRS = . tests
 
 AM_CPPFLAGS =                                  \
        -DG_LOG_DOMAIN=\"GLib-GObject\"         \
+       -DG_CLEANUP_MODULE=gobject              \
        $(glib_INCLUDES)                        \
        $(GLIB_DEBUG_FLAGS)                     \
        -DGOBJECT_COMPILATION
diff --git a/gobject/gobject.c b/gobject/gobject.c
index 899fe01..4b76a6b 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -100,6 +100,7 @@
  * ]|
  */
 
+G_CLEANUP_DEFINE
 
 /* --- macros --- */
 #define PARAM_SPEC_PARAM_ID(pspec)             ((pspec)->param_id)
diff --git a/gobject/tests/Makefile.am b/gobject/tests/Makefile.am
index 2c5cc1a..0176112 100644
--- a/gobject/tests/Makefile.am
+++ b/gobject/tests/Makefile.am
@@ -2,7 +2,7 @@ include $(top_srcdir)/glib-tap.mk
 
 LDADD = ../libgobject-2.0.la $(top_builddir)/glib/libglib-2.0.la
 AM_CPPFLAGS = -g $(gobject_INCLUDES) $(GLIB_DEBUG_FLAGS)
-DEFS = -DG_LOG_DOMAIN=\"GLib-GObject\"
+DEFS = -DG_LOG_DOMAIN=\"GLib-GObject\" -DG_CLEANUP_MODULE=tests
 AM_CFLAGS = $(GLIB_WARN_CFLAGS)
 
 # -----------------------------------------------------------------------------
diff --git a/gobject/tests/binding.c b/gobject/tests/binding.c
index 5f87e84..f7ce064 100644
--- a/gobject/tests/binding.c
+++ b/gobject/tests/binding.c
@@ -612,6 +612,8 @@ binding_unbind (void)
   g_object_unref (target);
 }
 
+G_CLEANUP_DEFINE
+
 int
 main (int argc, char *argv[])
 {
diff --git a/gobject/tests/boxed.c b/gobject/tests/boxed.c
index 70e3ea7..8d11662 100644
--- a/gobject/tests/boxed.c
+++ b/gobject/tests/boxed.c
@@ -615,6 +615,8 @@ test_boxed_checksum (void)
   g_value_unset (&value);
 }
 
+G_CLEANUP_DEFINE
+
 int
 main (int argc, char *argv[])
 {
diff --git a/gobject/tests/dynamictests.c b/gobject/tests/dynamictests.c
index a052e1a..a73037f 100644
--- a/gobject/tests/dynamictests.c
+++ b/gobject/tests/dynamictests.c
@@ -354,6 +354,8 @@ test_dynamic_interface_properties (void)
   g_object_unref (obj);
 }
 
+G_CLEANUP_DEFINE
+
 int
 main (int   argc,
       char *argv[])
diff --git a/gobject/tests/enums.c b/gobject/tests/enums.c
index 2d05d4b..1054ee6 100644
--- a/gobject/tests/enums.c
+++ b/gobject/tests/enums.c
@@ -112,6 +112,8 @@ test_flags_basic (void)
   g_value_unset (&value);
 }
 
+G_CLEANUP_DEFINE
+
 int
 main (int argc, char *argv[])
 {
diff --git a/gobject/tests/object.c b/gobject/tests/object.c
index 63c85a8..3aa73fe 100644
--- a/gobject/tests/object.c
+++ b/gobject/tests/object.c
@@ -137,6 +137,8 @@ test_object_constructor_infanticide (void)
 
 /* --------------------------------- */
 
+G_CLEANUP_DEFINE
+
 int
 main (int argc, char *argv[])
 {
diff --git a/gobject/tests/param.c b/gobject/tests/param.c
index 0215dc0..fb47148 100644
--- a/gobject/tests/param.c
+++ b/gobject/tests/param.c
@@ -1,3 +1,4 @@
+#define G_CLEANUP_MODULE tests
 #define GLIB_DISABLE_DEPRECATION_WARNINGS
 #include <glib-object.h>
 #include <stdlib.h>
@@ -826,6 +827,9 @@ test_param_default (void)
   g_param_spec_unref (param);
 }
 
+/* For cleaning up types defined in these tests */
+G_CLEANUP_DEFINE
+
 int
 main (int argc, char *argv[])
 {
diff --git a/gobject/tests/private.c b/gobject/tests/private.c
index 80ef9fc..7b15b0b 100644
--- a/gobject/tests/private.c
+++ b/gobject/tests/private.c
@@ -232,6 +232,8 @@ private_mixed_derived_instance (void)
   g_object_unref (mixed);
 }
 
+G_CLEANUP_DEFINE
+
 int
 main (int argc,
       char *argv[])
diff --git a/gobject/tests/properties.c b/gobject/tests/properties.c
index 7140f90..9021004 100644
--- a/gobject/tests/properties.c
+++ b/gobject/tests/properties.c
@@ -260,6 +260,8 @@ properties_construct (void)
   g_object_unref (obj);
 }
 
+G_CLEANUP_DEFINE
+
 int
 main (int argc, char *argv[])
 {
diff --git a/gobject/tests/reference.c b/gobject/tests/reference.c
index 0742339..23d5d8e 100644
--- a/gobject/tests/reference.c
+++ b/gobject/tests/reference.c
@@ -593,6 +593,8 @@ test_object_qdata2 (void)
   unref_value (v3);
 }
 
+G_CLEANUP_DEFINE
+
 int
 main (int argc, char **argv)
 {
diff --git a/gobject/tests/signals.c b/gobject/tests/signals.c
index a8ff35b..c1cbafb 100644
--- a/gobject/tests/signals.c
+++ b/gobject/tests/signals.c
@@ -1046,6 +1046,8 @@ test_stop_emission (void)
 
 /* --- */
 
+G_CLEANUP_DEFINE
+
 int
 main (int argc,
      char *argv[])
diff --git a/gobject/tests/testcommon.h b/gobject/tests/testcommon.h
index 7bfef05..5aea796 100644
--- a/gobject/tests/testcommon.h
+++ b/gobject/tests/testcommon.h
@@ -95,6 +95,9 @@ prefix ## _get_type (void)                                    \
 #define INTERFACE(init_func, iface_type)       \
   INTERFACE_FULL(object_type, init_func, iface_type)
 
+/* Get this into each test */
+G_CLEANUP_DEFINE
+
 G_END_DECLS
 
 #endif /* __TEST_COMMON_H__ */
diff --git a/gobject/tests/threadtests.c b/gobject/tests/threadtests.c
index 37b6b70..452c62a 100644
--- a/gobject/tests/threadtests.c
+++ b/gobject/tests/threadtests.c
@@ -335,6 +335,8 @@ test_threaded_weak_ref (void)
              get_wins, unref_wins);
 }
 
+G_CLEANUP_DEFINE
+
 int
 main (int   argc,
       char *argv[])
diff --git a/gobject/tests/type.c b/gobject/tests/type.c
index 1abe482..eee269f 100644
--- a/gobject/tests/type.c
+++ b/gobject/tests/type.c
@@ -138,6 +138,8 @@ test_next_base (void)
   g_assert (type == G_TYPE_INITIALLY_UNOWNED);
 }
 
+G_CLEANUP_DEFINE
+
 int
 main (int argc, char *argv[])
 {


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