fix build-break
[external/glib2.0.git] / tests / Makefile.am
1 include $(top_srcdir)/Makefile.decl
2
3 SUBDIRS=gobject refcount
4
5 AM_CPPFLAGS =                           \
6         $(gmodule_INCLUDES)             \
7         $(GLIB_DEBUG_FLAGS)
8
9 AM_CFLAGS = -g
10
11 EFENCE=
12
13 libglib = $(top_builddir)/glib/libglib-2.0.la
14 libgthread = $(top_builddir)/gthread/libgthread-2.0.la
15 libgmodule = $(top_builddir)/gmodule/libgmodule-2.0.la
16 libgobject = $(top_builddir)/gobject/libgobject-2.0.la
17
18 libadd_libgmodule = $(libgmodule)
19 libadd_libglib = $(libglib)
20 if PLATFORM_WIN32
21 no_undefined = -no-undefined
22
23 module_test_exp = module-test.exp
24
25 module-test.exp: module-test.o
26         dlltool --output-exp module-test.exp module-test.o
27
28 spawn_test_win32_gui = spawn-test-win32-gui
29
30 spawn_test_win32_gui_LDFLAGS = -mwindows
31
32 endif
33
34 EXTRA_DIST +=                                   \
35         $(test_scripts)                         \
36         makefile.msc.in                         \
37         casefold.txt                            \
38         casemap.txt                             \
39         gen-casefold-txt.pl                     \
40         gen-casemap-txt.pl                      \
41         iochannel-test-infile                   \
42         utf8.txt                                \
43         timeloop-basic.c                
44
45 BUILT_EXTRA_DIST =                              \
46         makefile.msc
47
48 if HAVE_CXX
49 CXX_TEST = cxx-test
50 cxx_test_LDADD = $(progs_ldadd)
51 cxx_test_SOURCES = cxx-test.C
52 else
53 CXX_TEST =
54 endif
55
56 if ENABLE_TIMELOOP
57 timeloop = timeloop timeloop-closure
58 endif
59 noinst_PROGRAMS = $(TEST_PROGS) \
60         testgdate               \
61         testgdateparser         \
62         unicode-normalize       \
63         unicode-collate         \
64         $(timeloop)             \
65         errorcheck-mutex-test   \
66         assert-msg-test
67
68 TEST_PROGS              += testglib
69 testglib_SOURCES         = testglib.c
70 testglib_LDADD           = $(libglib)
71
72
73 testgdate_LDADD = $(libglib)
74 testgdateparser_LDADD = $(libglib)
75 unicode_normalize_LDADD = $(libglib)
76 errorcheck_mutex_test_LDADD = $(libglib) $(libgthread) $(G_THREAD_LIBS) 
77 assert_msg_test_LDADD = $(libglib)
78 if ENABLE_TIMELOOP
79 timeloop_LDADD = $(libglib) $(libgthread)
80 timeloop_closure_LDADD = $(libglib) $(libgobject) $(libgthread)
81 endif
82
83 test_programs =                                 \
84         atomic-test                             \
85         bit-test                                \
86         $(CXX_TEST)                             \
87         child-test                              \
88         completion-test                         \
89         dirname-test                            \
90         file-test                               \
91         env-test                                \
92         gio-test                                \
93         iochannel-test                          \
94         mainloop-test                           \
95         mapping-test                            \
96         module-test                             \
97         onceinit                                \
98         asyncqueue-test                         \
99         qsort-test                              \
100         relation-test                           \
101         slice-test                              \
102         slice-color                             \
103         slice-concurrent                        \
104         slice-threadinit                        \
105         spawn-test                              \
106         $(spawn_test_win32_gui)                 \
107         thread-test                             \
108         threadpool-test                         \
109         type-test                               \
110         unicode-caseconv                        \
111         unicode-encoding
112
113 test_scripts = run-collate-tests.sh run-assert-msg-test.sh
114
115 test_script_support_programs = unicode-collate
116
117 check_PROGRAMS = $(test_programs) $(test_script_support_programs)
118
119 TESTS = $(test_programs) $(test_scripts)
120 TESTS_ENVIRONMENT = srcdir=$(srcdir) \
121         LIBCHARSET_ALIAS_DIR=$(top_builddir)/glib/libcharset \
122         MALLOC_CHECK_=2 \
123         MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256))
124
125 progs_ldadd = $(EFENCE) $(libglib) $(EFENCE)
126 thread_ldadd = $(libgthread) $(G_THREAD_LIBS) $(progs_ldadd)
127 module_ldadd = $(libgmodule) $(G_MODULE_LIBS) $(progs_ldadd)
128
129 atomic_test_LDADD = $(progs_ldadd)
130 bit_test_LDADD = $(progs_ldadd)
131 child_test_LDADD = $(thread_ldadd)
132 completion_test_LDADD = $(progs_ldadd)
133 date_test_LDADD = $(progs_ldadd)
134 dirname_test_LDADD = $(progs_ldadd)
135 file_test_LDADD = $(progs_ldadd)
136 env_test_LDADD = $(progs_ldadd)
137 gio_test_LDADD = $(progs_ldadd)
138 iochannel_test_LDADD = $(progs_ldadd)
139 list_test_LDADD = $(progs_ldadd)
140 mainloop_test_LDADD = $(thread_ldadd)
141 mapping_test_LDADD = $(progs_ldadd)
142 module_test_LDADD = $(module_ldadd) $(module_test_exp)
143 module_test_LDFLAGS = $(G_MODULE_LDFLAGS)
144 onceinit_LDADD = $(thread_ldadd)
145 asyncqueue_test_LDADD = $(thread_ldadd)
146 qsort_test_LDADD = $(progs_ldadd)
147 relation_test_LDADD = $(progs_ldadd)
148 slice_test_SOURCES = slice-test.c memchunks.c
149 slice_test_LDADD = $(thread_ldadd)
150 slice_color_SOURCES = slice-color.c memchunks.c
151 slice_color_LDADD = $(thread_ldadd)
152 slice_concurrent_SOURCES = slice-concurrent.c
153 slice_concurrent_LDADD = $(thread_ldadd)
154 slice_threadinit_SOURCES = slice-threadinit.c
155 slice_threadinit_LDADD = $(thread_ldadd)
156 spawn_test_LDADD = $(progs_ldadd)
157 thread_test_LDADD = $(thread_ldadd)
158 threadpool_test_LDADD = $(thread_ldadd)
159 type_test_LDADD = $(progs_ldadd)
160 unicode_encoding_LDADD = $(progs_ldadd)
161 unicode_caseconv_LDADD = $(progs_ldadd)
162 unicode_collate_LDADD = $(progs_ldadd)
163
164 noinst_LTLIBRARIES = libmoduletestplugin_a.la libmoduletestplugin_b.la
165
166 libmoduletestplugin_a_la_SOURCES = libmoduletestplugin_a.c
167 libmoduletestplugin_a_la_LDFLAGS = $(G_MODULE_LDFLAGS) -avoid-version -module $(no_undefined) -rpath $(libdir)
168 libmoduletestplugin_a_la_LIBADD = $(G_MODULE_LIBS) $(libadd_libgmodule) $(libadd_libglib)
169
170 libmoduletestplugin_b_la_SOURCES = libmoduletestplugin_b.c
171 libmoduletestplugin_b_la_LDFLAGS = $(G_MODULE_LDFLAGS) -avoid-version -module $(no_undefined) -rpath $(libdir)
172 libmoduletestplugin_b_la_LIBADD = $(G_MODULE_LIBS) $(libadd_libgmodule) $(libadd_libglib)
173
174 dist-hook: $(BUILT_EXTRA_DIST)
175         files='$(BUILT_EXTRA_DIST)';                            \
176         for f in $$files; do                                    \
177           if test -f $$f; then d=.; else d=$(srcdir); fi;       \
178           cp $$d/$$f $(distdir) || exit 1; done
179         mkdir $(distdir)/collate;                               \
180         for f in $(srcdir)/collate/* ; do                       \
181           if test -f $$f; then cp $$f $(distdir)/collate; fi; done
182
183 DISTCLEANFILES =                \
184         iochannel-test-outfile  \
185         file-test-get-contents  \
186         maptest                 \
187         mapchild                \
188         collate.out