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