Move charset conversion tests to the test framework
[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         assert-msg-test
69
70 TEST_PROGS              += testglib
71 testglib_SOURCES         = testglib.c
72 testglib_LDADD           = $(libglib)
73
74
75 patterntest_LDADD = $(libglib)
76 testgdate_LDADD = $(libglib)
77 testgdateparser_LDADD = $(libglib)
78 unicode_normalize_LDADD = $(libglib)
79 errorcheck_mutex_test_LDADD = $(libglib) $(libgthread) $(G_THREAD_LIBS) 
80 assert_msg_test_LDADD = $(libglib)
81 if ENABLE_TIMELOOP
82 timeloop_LDADD = $(libglib)
83 timeloop_closure_LDADD = $(libglib) $(libgobject)
84 endif
85
86 test_programs =                                 \
87         atomic-test                             \
88         bit-test                                \
89         $(CXX_TEST)                             \
90         child-test                              \
91         completion-test                         \
92         dirname-test                            \
93         file-test                               \
94         env-test                                \
95         gio-test                                \
96         iochannel-test                          \
97         list-test                               \
98         mainloop-test                           \
99         mapping-test                            \
100         markup-collect                          \
101         markup-escape-test                      \
102         module-test                             \
103         onceinit                                \
104         patterntest                             \
105         queue-test                              \
106         asyncqueue-test                         \
107         qsort-test                              \
108         relation-test                           \
109         shell-test                              \
110         slist-test                              \
111         slice-test                              \
112         slice-color                             \
113         slice-concurrent                        \
114         slice-threadinit                        \
115         spawn-test                              \
116         $(spawn_test_win32_gui)                 \
117         thread-test                             \
118         threadpool-test                         \
119         tree-test                               \
120         type-test                               \
121         unicode-caseconv                        \
122         unicode-encoding                        \
123         uri-test
124
125 test_scripts = run-markup-tests.sh run-collate-tests.sh run-bookmark-test.sh run-assert-msg-test.sh
126
127 test_script_support_programs = markup-test unicode-collate bookmarkfile-test
128
129 check_PROGRAMS = $(test_programs) $(test_script_support_programs)
130
131 TESTS = $(test_programs) $(test_scripts)
132 TESTS_ENVIRONMENT = srcdir=$(srcdir) \
133         LIBCHARSET_ALIAS_DIR=$(top_builddir)/glib/libcharset \
134         MALLOC_CHECK_=2 \
135         MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256))
136
137 progs_ldadd = $(EFENCE) $(libglib) $(EFENCE)
138 thread_ldadd = $(libgthread) $(G_THREAD_LIBS) $(progs_ldadd)
139 module_ldadd = $(libgmodule) $(G_MODULE_LIBS) $(progs_ldadd)
140
141 atomic_test_LDADD = $(progs_ldadd)
142 bit_test_LDADD = $(progs_ldadd)
143 bookmarkfile_test_LDADD = $(progs_ldadd)
144 child_test_LDADD = $(thread_ldadd)
145 completion_test_LDADD = $(progs_ldadd)
146 date_test_LDADD = $(progs_ldadd)
147 dirname_test_LDADD = $(progs_ldadd)
148 file_test_LDADD = $(progs_ldadd)
149 env_test_LDADD = $(progs_ldadd)
150 gio_test_LDADD = $(progs_ldadd)
151 iochannel_test_LDADD = $(progs_ldadd)
152 list_test_LDADD = $(progs_ldadd)
153 mainloop_test_LDADD = $(thread_ldadd)
154 markup_test_LDADD = $(progs_ldadd)
155 mapping_test_LDADD = $(progs_ldadd)
156 markup_escape_test_LDADD = $(progs_ldadd)
157 module_test_LDADD = $(module_ldadd) $(module_test_exp)
158 module_test_LDFLAGS = $(G_MODULE_LDFLAGS)
159 onceinit_LDADD = $(thread_ldadd)
160 queue_test_LDADD = $(progs_ldadd)
161 asyncqueue_test_LDADD = $(thread_ldadd)
162 qsort_test_LDADD = $(progs_ldadd)
163 relation_test_LDADD = $(progs_ldadd)
164 shell_test_LDADD = $(progs_ldadd)
165 slist_test_LDADD = $(progs_ldadd)
166 slice_test_SOURCES = slice-test.c memchunks.c
167 slice_test_LDADD = $(thread_ldadd)
168 slice_color_SOURCES = slice-color.c memchunks.c
169 slice_color_LDADD = $(thread_ldadd)
170 slice_concurrent_SOURCES = slice-concurrent.c
171 slice_concurrent_LDADD = $(thread_ldadd)
172 slice_threadinit_SOURCES = slice-threadinit.c
173 slice_threadinit_LDADD = $(thread_ldadd)
174 spawn_test_LDADD = $(progs_ldadd)
175 thread_test_LDADD = $(thread_ldadd)
176 threadpool_test_LDADD = $(thread_ldadd)
177 tree_test_LDADD = $(progs_ldadd)
178 type_test_LDADD = $(progs_ldadd)
179 unicode_encoding_LDADD = $(progs_ldadd)
180 unicode_caseconv_LDADD = $(progs_ldadd)
181 unicode_collate_LDADD = $(progs_ldadd)
182 uri_test_LDADD = $(progs_ldadd)
183 markup_collect_LDADD = $(progs_ldadd)
184
185 noinst_LTLIBRARIES = libmoduletestplugin_a.la libmoduletestplugin_b.la
186
187 libmoduletestplugin_a_la_SOURCES = libmoduletestplugin_a.c
188 libmoduletestplugin_a_la_LDFLAGS = $(G_MODULE_LDFLAGS) -avoid-version -module $(no_undefined) -rpath $(libdir)
189 libmoduletestplugin_a_la_LIBADD = $(G_MODULE_LIBS) $(libadd_libgmodule) $(libadd_libglib)
190
191 libmoduletestplugin_b_la_SOURCES = libmoduletestplugin_b.c
192 libmoduletestplugin_b_la_LDFLAGS = $(G_MODULE_LDFLAGS) -avoid-version -module $(no_undefined) -rpath $(libdir)
193 libmoduletestplugin_b_la_LIBADD = $(G_MODULE_LIBS) $(libadd_libgmodule) $(libadd_libglib)
194
195 dist-hook: $(BUILT_EXTRA_DIST)
196         files='$(BUILT_EXTRA_DIST)';                            \
197         for f in $$files; do                                    \
198           if test -f $$f; then d=.; else d=$(srcdir); fi;       \
199           cp $$d/$$f $(distdir) || exit 1; done
200         mkdir $(distdir)/markups;                               \
201         for f in $(srcdir)/markups/* ; do                       \
202           cp $$f $(distdir)/markups; done 
203         mkdir $(distdir)/collate;                               \
204         for f in $(srcdir)/collate/* ; do                       \
205           if test -f $$f; then cp $$f $(distdir)/collate; fi; done
206         mkdir $(distdir)/bookmarks;                             \
207         for f in $(srcdir)/bookmarks/* ; do                     \
208           cp $$f $(distdir)/bookmarks; done 
209
210 DISTCLEANFILES =                \
211         iochannel-test-outfile  \
212         file-test-get-contents  \
213         maptest                 \
214         mapchild                \
215         collate.out