Change a pair of TESTS = to TEST +=
[platform/upstream/glib.git] / tests / gobject / Makefile.am
1 include $(top_srcdir)/glib.mk
2
3 LDADD = $(top_builddir)/glib/libglib-2.0.la $(top_builddir)/gobject/libgobject-2.0.la
4 AM_CPPFLAGS = $(gmodule_INCLUDES) $(GLIB_DEBUG_FLAGS)
5 DEFS = -DGLIB_DISABLE_DEPRECATION_WARNINGS -DG_LOG_DOMAIN=\"GLib\"
6 AM_CFLAGS = -g
7
8 # So far, only two gtester-ified cases
9 test_programs = \
10         gvalue-test                             \
11         paramspec-test                          \
12         $(NULL)
13
14 # These are not yet gtester-ified, so mark them as for 'installed' only so we
15 # don't run them under the framework.  We will handle them manually below.
16 installed_test_programs = \
17         deftype                                 \
18         accumulator                             \
19         defaultiface                            \
20         dynamictype                             \
21         override                                \
22         singleton                               \
23         references                              \
24         $(NULL)
25
26 # Don't install these ones, and keep them out of 'make check' because they take too long...
27 noinst_PROGRAMS += \
28         performance                             \
29         performance-threaded                    \
30         $(NULL)
31
32 # Run the 'installed' tests manually in-tree.
33 # This will cause them to be built even if installed tests are disabled.
34 check_PROGRAMS += $(installed_test_programs) $(installed_test_extra_programs)
35 TESTS += $(installed_test_programs)
36 TESTS_ENVIRONMENT = \
37         LIBCHARSET_ALIAS_DIR=$(top_builddir)/glib/libcharset    \
38         MALLOC_CHECK_=2                                         \
39         MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256))
40
41 accumulator_SOURCES = accumulator.c testmarshal.c testmarshal.h
42 defaultiface_SOURCES = defaultiface.c testmodule.c testmodule.h
43 dynamictype_SOURCES = dynamictype.c testmodule.c testmodule.h
44
45 if ENABLE_TIMELOOP
46 installed_test_programs += timeloop-closure
47 endif
48
49 if CROSS_COMPILING
50   glib_genmarshal=$(GLIB_GENMARSHAL)
51 else
52   glib_genmarshal=$(top_builddir)/gobject/glib-genmarshal
53 endif
54
55 testmarshal.h: stamp-testmarshal.h
56         @true
57 stamp-testmarshal.h: @REBUILD@ testmarshal.list $(glib_genmarshal)
58         $(AM_V_GEN) $(glib_genmarshal) --prefix=test_marshal $(srcdir)/testmarshal.list --header >> xgen-gmh \
59         && (cmp -s xgen-gmh testmarshal.h 2>/dev/null || cp xgen-gmh testmarshal.h) \
60         && rm -f xgen-gmh xgen-gmh~ \
61         && echo timestamp > $@
62 testmarshal.c: @REBUILD@ testmarshal.h testmarshal.list $(glib_genmarshal)
63         $(AM_V_GEN) (echo "#include \"testmarshal.h\""; $(glib_genmarshal) --prefix=test_marshal $(srcdir)/testmarshal.list --body) >> xgen-gmc \
64         && cp xgen-gmc testmarshal.c \
65         && rm -f xgen-gmc xgen-gmc~
66
67 BUILT_SOURCES += testmarshal.h testmarshal.c
68 CLEANFILES += stamp-testmarshal.h
69
70 EXTRA_DIST += \
71         testcommon.h                            \
72         testmarshal.list
73
74 BUILT_EXTRA_DIST += \
75         testmarshal.h                           \
76         testmarshal.c
77
78 dist-hook: $(BUILT_EXTRA_DIST)
79         files='$(BUILT_EXTRA_DIST)';                            \
80         for f in $$files; do                                    \
81           if test -f $$f; then d=.; else d=$(srcdir); fi;       \
82           cp $$d/$$f $(distdir) || exit 1; done
83
84 distclean-local:
85         if test $(srcdir) = .; then :; else     \
86             rm -f $(BUILT_EXTRA_DIST);          \
87         fi