Move another test
[platform/upstream/glib.git] / tests / Makefile.am
1 include $(top_srcdir)/Makefile.decl
2
3 SUBDIRS=gobject refcount
4
5 if ENABLE_REGEX
6 enable_regex = -DENABLE_REGEX
7 else
8 enable_regex =
9 endif
10
11 AM_CPPFLAGS =                           \
12         -I$(top_srcdir)                 \
13         -I$(top_srcdir)/glib            \
14         -I$(top_srcdir)/gmodule         \
15         $(GLIB_DEBUG_FLAGS)             \
16         $(enable_regex)
17
18 AM_CFLAGS = -g
19
20 EFENCE=
21
22 libglib = $(top_builddir)/glib/libglib-2.0.la
23 libgthread = $(top_builddir)/gthread/libgthread-2.0.la
24 libgmodule = $(top_builddir)/gmodule/libgmodule-2.0.la
25 libgobject = $(top_builddir)/gobject/libgobject-2.0.la
26
27 libadd_libgmodule = $(libgmodule)
28 libadd_libglib = $(libglib)
29 if PLATFORM_WIN32
30 no_undefined = -no-undefined
31
32 module_test_exp = module-test.exp
33
34 module-test.exp: module-test.o
35         dlltool --output-exp module-test.exp module-test.o
36
37 spawn_test_win32_gui = spawn-test-win32-gui
38
39 spawn_test_win32_gui_LDFLAGS = -mwindows
40
41 endif
42
43 EXTRA_DIST +=                                   \
44         $(test_scripts)                         \
45         makefile.msc.in                         \
46         casefold.txt                            \
47         casemap.txt                             \
48         gen-casefold-txt.pl                     \
49         gen-casemap-txt.pl                      \
50         iochannel-test-infile                   \
51         utf8.txt                                \
52         timeloop-basic.c                
53
54 BUILT_EXTRA_DIST =                              \
55         makefile.msc
56
57 if HAVE_CXX
58 CXX_TEST = cxx-test
59 cxx_test_LDADD = $(progs_ldadd)
60 cxx_test_SOURCES = cxx-test.C
61 else
62 CXX_TEST =
63 endif
64
65 if ENABLE_TIMELOOP
66 timeloop = timeloop timeloop-closure
67 endif
68 noinst_PROGRAMS = $(TEST_PROGS) \
69         testgdate               \
70         testgdateparser         \
71         unicode-normalize       \
72         unicode-collate         \
73         $(timeloop)             \
74         errorcheck-mutex-test
75
76 TEST_PROGS              += scannerapi
77 scannerapi_SOURCES       = scannerapi.c
78 scannerapi_LDADD         = $(progs_ldadd)
79 TEST_PROGS              += testglib
80 testglib_SOURCES         = testglib.c
81 testglib_LDADD           = $(libglib)
82 TEST_PROGS              += testingbase64
83 testingbase64_SOURCES    = testingbase64.c
84 testingbase64_LDADD      = $(progs_ldadd)
85
86
87 patterntest_LDADD = $(libglib)
88 testgdate_LDADD = $(libglib)
89 testgdateparser_LDADD = $(libglib)
90 unicode_normalize_LDADD = $(libglib)
91 errorcheck_mutex_test_LDADD = $(libglib) $(libgthread) $(G_THREAD_LIBS) 
92 if ENABLE_TIMELOOP
93 timeloop_LDADD = $(libglib)
94 timeloop_closure_LDADD = $(libglib) $(libgobject)
95 endif
96
97 test_programs =                                 \
98         atomic-test                             \
99         array-test                              \
100         base64-test                             \
101         bit-test                                \
102         $(CXX_TEST)                             \
103         checksum-test                           \
104         child-test                              \
105         completion-test                         \
106         convert-test                            \
107         date-test                               \
108         dirname-test                            \
109         file-test                               \
110         env-test                                \
111         gio-test                                \
112         hash-test                               \
113         iochannel-test                          \
114         list-test                               \
115         mainloop-test                           \
116         mapping-test                            \
117         markup-collect                          \
118         markup-escape-test                      \
119         module-test                             \
120         node-test                               \
121         onceinit                                \
122         patterntest                             \
123         printf-test                             \
124         queue-test                              \
125         asyncqueue-test                         \
126         qsort-test                              \
127         rand-test                               \
128         relation-test                           \
129         sequence-test                           \
130         shell-test                              \
131         slist-test                              \
132         slice-test                              \
133         slice-color                             \
134         slice-concurrent                        \
135         slice-threadinit                        \
136         spawn-test                              \
137         $(spawn_test_win32_gui)                 \
138         string-test                             \
139         thread-test                             \
140         threadpool-test                         \
141         tree-test                               \
142         type-test                               \
143         unicode-caseconv                        \
144         unicode-encoding                        \
145         utf8-validate                           \
146         utf8-pointer                            \
147         uri-test                                \
148         regex-test
149
150 test_scripts = run-markup-tests.sh run-collate-tests.sh run-bookmark-test.sh
151
152 test_script_support_programs = markup-test unicode-collate bookmarkfile-test
153
154 check_PROGRAMS = $(test_programs) $(test_script_support_programs)
155
156 TESTS = $(test_programs) $(test_scripts)
157 TESTS_ENVIRONMENT = srcdir=$(srcdir) \
158         LIBCHARSET_ALIAS_DIR=$(top_builddir)/glib/libcharset \
159         MALLOC_CHECK_=2 \
160         MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256))
161
162 progs_ldadd = $(EFENCE) $(libglib) $(EFENCE)
163 thread_ldadd = $(libgthread) $(G_THREAD_LIBS) $(progs_ldadd)
164 module_ldadd = $(libgmodule) $(G_MODULE_LIBS) $(progs_ldadd)
165
166 atomic_test_LDADD = $(progs_ldadd)
167 array_test_LDADD = $(progs_ldadd)
168 base64_test_LDADD = $(progs_ldadd)
169 bit_test_LDADD = $(progs_ldadd)
170 bookmarkfile_test_LDADD = $(progs_ldadd)
171 checksum_test_LDADD = $(progs_ldadd)
172 child_test_LDADD = $(thread_ldadd)
173 completion_test_LDADD = $(progs_ldadd)
174 convert_test_LDADD = $(progs_ldadd)
175 date_test_LDADD = $(progs_ldadd)
176 dirname_test_LDADD = $(progs_ldadd)
177 file_test_LDADD = $(progs_ldadd)
178 env_test_LDADD = $(progs_ldadd)
179 gio_test_LDADD = $(progs_ldadd)
180 hash_test_LDADD = $(progs_ldadd)
181 iochannel_test_LDADD = $(progs_ldadd)
182 list_test_LDADD = $(progs_ldadd)
183 mainloop_test_LDADD = $(thread_ldadd)
184 markup_test_LDADD = $(progs_ldadd)
185 mapping_test_LDADD = $(progs_ldadd)
186 markup_escape_test_LDADD = $(progs_ldadd)
187 module_test_LDADD = $(module_ldadd) $(module_test_exp)
188 module_test_LDFLAGS = $(G_MODULE_LDFLAGS)
189 node_test_LDADD = $(progs_ldadd)
190 onceinit_LDADD = $(thread_ldadd)
191 option_test_LDADD = $(progs_ldadd)
192 printf_test_LDADD = $(progs_ldadd)
193 queue_test_LDADD = $(progs_ldadd)
194 asyncqueue_test_LDADD = $(thread_ldadd)
195 qsort_test_LDADD = $(progs_ldadd)
196 rand_test_LDADD = $(progs_ldadd)
197 relation_test_LDADD = $(progs_ldadd)
198 sequence_test_LDADD = $(progs_ldadd)
199 shell_test_LDADD = $(progs_ldadd)
200 slist_test_LDADD = $(progs_ldadd)
201 slice_test_SOURCES = slice-test.c memchunks.c
202 slice_test_LDADD = $(thread_ldadd)
203 slice_color_SOURCES = slice-color.c memchunks.c
204 slice_color_LDADD = $(thread_ldadd)
205 slice_concurrent_SOURCES = slice-concurrent.c
206 slice_concurrent_LDADD = $(thread_ldadd)
207 slice_threadinit_SOURCES = slice-threadinit.c
208 slice_threadinit_LDADD = $(thread_ldadd)
209 spawn_test_LDADD = $(progs_ldadd)
210 string_test_LDADD = $(progs_ldadd)
211 thread_test_LDADD = $(thread_ldadd)
212 threadpool_test_LDADD = $(thread_ldadd)
213 tree_test_LDADD = $(progs_ldadd)
214 type_test_LDADD = $(progs_ldadd)
215 unicode_encoding_LDADD = $(progs_ldadd)
216 unicode_caseconv_LDADD = $(progs_ldadd)
217 unicode_collate_LDADD = $(progs_ldadd)
218 utf8_validate_LDADD = $(progs_ldadd)
219 utf8_pointer_LDADD = $(progs_ldadd)
220 uri_test_LDADD = $(progs_ldadd)
221 regex_test_LDADD = $(progs_ldadd)
222 markup_collect_LDADD = $(progs_ldadd)
223
224 lib_LTLIBRARIES = libmoduletestplugin_a.la libmoduletestplugin_b.la
225
226 # Prevent those libs from being installed
227 install-libLTLIBRARIES:
228         :
229
230 libmoduletestplugin_a_la_SOURCES = libmoduletestplugin_a.c
231 libmoduletestplugin_a_la_LDFLAGS = $(G_MODULE_LDFLAGS) -avoid-version -module $(no_undefined) -rpath $(libdir)
232 libmoduletestplugin_a_la_LIBADD = $(G_MODULE_LIBS) $(libadd_libgmodule) $(libadd_libglib)
233
234 libmoduletestplugin_b_la_SOURCES = libmoduletestplugin_b.c
235 libmoduletestplugin_b_la_LDFLAGS = $(G_MODULE_LDFLAGS) -avoid-version -module $(no_undefined) -rpath $(libdir)
236 libmoduletestplugin_b_la_LIBADD = $(G_MODULE_LIBS) $(libadd_libgmodule) $(libadd_libglib)
237
238 dist-hook: $(BUILT_EXTRA_DIST)
239         files='$(BUILT_EXTRA_DIST)';                            \
240         for f in $$files; do                                    \
241           if test -f $$f; then d=.; else d=$(srcdir); fi;       \
242           cp $$d/$$f $(distdir) || exit 1; done
243         mkdir $(distdir)/markups;                               \
244         for f in $(srcdir)/markups/* ; do                       \
245           cp $$f $(distdir)/markups; done 
246         mkdir $(distdir)/collate;                               \
247         for f in $(srcdir)/collate/* ; do                       \
248           if test -f $$f; then cp $$f $(distdir)/collate; fi; done
249         mkdir $(distdir)/bookmarks;                             \
250         for f in $(srcdir)/bookmarks/* ; do                     \
251           cp $$f $(distdir)/bookmarks; done 
252
253 DISTCLEANFILES =                \
254         iochannel-test-outfile  \
255         file-test-get-contents  \
256         maptest                 \
257         mapchild                \
258         collate.out