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