Revert "defaultiface: Fix leak in test"
[platform/upstream/glib.git] / tests / gobject / Makefile.am
index b668766..84f7410 100644 (file)
@@ -1,22 +1,52 @@
-INCLUDES =                                     \
-       -I$(top_srcdir)                         \
-       -I$(top_srcdir)/glib                    \
-       -I$(top_srcdir)/gmodule                 \
-       $(GLIB_DEBUG_FLAGS)
-
-libglib = $(top_builddir)/glib/libglib-2.0.la
-libgthread = $(top_builddir)/gthread/libgthread-2.0.la
-libgmodule = $(top_builddir)/gmodule/libgmodule-2.0.la
-libgobject = $(top_builddir)/gobject/libgobject-2.0.la
-
-########################################################################
-
-noinst_LTLIBRARIES = libtestgobject.la
-
-libtestgobject_la_SOURCES =    \
-       testcommon.h            \
-       testmarshal.h           \
-       testmarshal.c
+include $(top_srcdir)/glib.mk
+
+LDADD = $(top_builddir)/glib/libglib-2.0.la $(top_builddir)/gobject/libgobject-2.0.la
+AM_CPPFLAGS = $(gmodule_INCLUDES) $(GLIB_DEBUG_FLAGS)
+DEFS = -DGLIB_DISABLE_DEPRECATION_WARNINGS -DG_LOG_DOMAIN=\"GLib\"
+AM_CFLAGS = -g
+
+# So far, only two gtester-ified cases
+test_programs = \
+       gvalue-test                             \
+       paramspec-test                          \
+       $(NULL)
+
+# These are not yet gtester-ified, so mark them as for 'installed' only so we
+# don't run them under the framework.  We will handle them manually below.
+installed_test_programs = \
+       deftype                                 \
+       accumulator                             \
+       defaultiface                            \
+       dynamictype                             \
+       override                                \
+       signals                                 \
+       singleton                               \
+       references                              \
+       $(NULL)
+
+# Don't install these ones, and keep them out of 'make check' because they take too long...
+noinst_PROGRAMS += \
+       performance                             \
+       performance-threaded                    \
+       $(NULL)
+
+# Run the 'installed' tests manually in-tree.
+# This will cause them to be built even if installed tests are disabled.
+check_PROGRAMS += $(installed_test_programs) $(installed_test_extra_programs)
+TESTS += $(installed_test_programs)
+TESTS_ENVIRONMENT = \
+       LIBCHARSET_ALIAS_DIR=$(top_builddir)/glib/libcharset    \
+       MALLOC_CHECK_=2                                         \
+       MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256))
+
+accumulator_SOURCES = accumulator.c testmarshal.c testmarshal.h
+signals_SOURCES = signals.c
+defaultiface_SOURCES = defaultiface.c testmodule.c testmodule.h
+dynamictype_SOURCES = dynamictype.c testmodule.c testmodule.h
+
+if ENABLE_TIMELOOP
+installed_test_programs += timeloop-closure
+endif
 
 if CROSS_COMPILING
   glib_genmarshal=$(GLIB_GENMARSHAL)
@@ -27,45 +57,33 @@ endif
 testmarshal.h: stamp-testmarshal.h
        @true
 stamp-testmarshal.h: @REBUILD@ testmarshal.list $(glib_genmarshal)
-       $(glib_genmarshal) --prefix=test_marshal $(srcdir)/testmarshal.list --header >> xgen-gmh \
+       $(AM_V_GEN) $(glib_genmarshal) --prefix=test_marshal $(srcdir)/testmarshal.list --header >> xgen-gmh \
        && (cmp -s xgen-gmh testmarshal.h 2>/dev/null || cp xgen-gmh testmarshal.h) \
        && rm -f xgen-gmh xgen-gmh~ \
        && echo timestamp > $@
-testmarshal.c: @REBUILD@ testmarshal.list $(glib_genmarshal)
-       $(glib_genmarshal) --prefix=test_marshal $(srcdir)/testmarshal.list --body >> xgen-gmc \
+testmarshal.c: @REBUILD@ testmarshal.h testmarshal.list $(glib_genmarshal)
+       $(AM_V_GEN) (echo "#include \"testmarshal.h\""; $(glib_genmarshal) --prefix=test_marshal $(srcdir)/testmarshal.list --body) >> xgen-gmc \
        && cp xgen-gmc testmarshal.c \
        && rm -f xgen-gmc xgen-gmc~
 
-BUILT_SOURCES = testmarshal.h testmarshal.c
-
-########################################################################
-
-LDADD = $(libgobject) libtestgobject.la
-
-test_programs =                                        \
-       accumulator                             \
-       ifaceinit                               \
-       override
-
-check_PROGRAMS = $(test_programs)
-
-TESTS = $(test_programs)
-TESTS_ENVIRONMENT = srcdir=$(srcdir) \
-       LIBCHARSET_ALIAS_DIR=$(top_builddir)/glib/libcharset
+BUILT_SOURCES += testmarshal.h testmarshal.c
+CLEANFILES += stamp-testmarshal.h
 
-########################################################################
+EXTRA_DIST += \
+       testcommon.h                            \
+       testmarshal.list
 
-BUILT_EXTRA_DIST =                             \
+BUILT_EXTRA_DIST += \
        testmarshal.h                           \
        testmarshal.c
 
-dist-hook: $(BUILT_EXTRA_DIST)                                 \
+dist-hook: $(BUILT_EXTRA_DIST)
        files='$(BUILT_EXTRA_DIST)';                            \
        for f in $$files; do                                    \
          if test -f $$f; then d=.; else d=$(srcdir); fi;       \
          cp $$d/$$f $(distdir) || exit 1; done
 
-distclean-local:                               \
+distclean-local:
        if test $(srcdir) = .; then :; else     \
            rm -f $(BUILT_EXTRA_DIST);          \
        fi