5ef08250dac903ff338393057fc374e97de60a30
[platform/upstream/glib.git] / gio / tests / Makefile.am
1
2 NULL =
3 BUILT_SOURCES =
4
5 include $(top_srcdir)/Makefile.decl
6
7 SUBDIRS = gdbus-object-manager-example
8
9 INCLUDES =                      \
10         -DG_LOG_DOMAIN=\"GLib-GIO\" \
11         $(gio_INCLUDES)         \
12         $(GLIB_DEBUG_FLAGS)     \
13         -I$(top_builddir)/gio   \
14         -I$(top_srcdir)/gio     \
15         $(DBUS1_CFLAGS)         \
16         -DSRCDIR=\""$(srcdir)"\"
17
18 noinst_PROGRAMS = $(TEST_PROGS) $(SAMPLE_PROGS)
19 noinst_DATA = $(MISC_STUFF)
20
21 LDADD     =                                     \
22         $(top_builddir)/glib/libglib-2.0.la             \
23         $(top_builddir)/gthread/libgthread-2.0.la       \
24         $(top_builddir)/gobject/libgobject-2.0.la       \
25         $(top_builddir)/gmodule/libgmodule-2.0.la       \
26         $(top_builddir)/gio/libgio-2.0.la
27
28 TEST_PROGS +=                   \
29         io-stream               \
30         memory-input-stream     \
31         memory-output-stream    \
32         readwrite               \
33         g-file                  \
34         g-file-info             \
35         converter-stream        \
36         data-input-stream       \
37         data-output-stream      \
38         g-icon                  \
39         buffered-input-stream   \
40         buffered-output-stream  \
41         sleepy-stream           \
42         filter-streams          \
43         volumemonitor           \
44         simple-async-result     \
45         srvtarget               \
46         contexts                \
47         gsettings               \
48         gschema-compile         \
49         async-close-output-stream \
50         gdbus-addresses         \
51         network-address         \
52         gdbus-message           \
53         socket                  \
54         pollable                \
55         tls-certificate         \
56         tls-interaction         \
57         cancellable             \
58         vfs                     \
59         network-monitor         \
60         fileattributematcher    \
61         resources               \
62         proxy-test              \
63         inet-address            \
64         permission              \
65         task                    \
66         credentials             \
67         $(NULL)
68
69 if HAVE_DBUS_DAEMON
70 TEST_PROGS +=                   \
71         actions                 \
72         gdbus-connection        \
73         gdbus-connection-loss   \
74         gdbus-connection-slow   \
75         gdbus-names             \
76         gdbus-proxy             \
77         gdbus-proxy-threads     \
78         gdbus-proxy-well-known-name \
79         gdbus-introspection     \
80         gdbus-threading         \
81         gdbus-export            \
82         gdbus-error             \
83         gdbus-bz627724          \
84         gmenumodel              \
85         $(NULL)
86 endif
87
88
89 if OS_UNIX
90 TEST_PROGS +=                   \
91         gdbus-close-pending     \
92         gdbus-connection-flush  \
93         gdbus-peer              \
94         gdbus-exit-on-close     \
95         gdbus-non-socket        \
96         gdbus-peer-object-manager \
97         appinfo                 \
98         contenttype             \
99         mimeapps                \
100         file                    \
101         $(NULL)
102 endif
103
104 SAMPLE_PROGS =                          \
105         resolver                        \
106         socket-server                   \
107         socket-client                   \
108         echo-server                     \
109         httpd                           \
110         send-data                       \
111         filter-cat                      \
112         gdbus-example-export            \
113         gdbus-example-own-name          \
114         gdbus-example-watch-name        \
115         gdbus-example-watch-proxy       \
116         gdbus-example-server            \
117         gdbus-example-subtree           \
118         gdbus-example-peer              \
119         gdbus-example-proxy-subclass    \
120         gdbus-connection-flush-helper   \
121         proxy                           \
122         gapplication-example-open       \
123         gapplication-example-cmdline    \
124         gapplication-example-cmdline2   \
125         gapplication-example-cmdline3   \
126         gapplication-example-actions    \
127         gapplication-example-dbushooks  \
128         gdbus-daemon                    \
129         $(NULL)
130
131 if OS_UNIX
132 TEST_PROGS +=                   \
133         live-g-file             \
134         desktop-app-info        \
135         unix-fd                 \
136         unix-streams            \
137         gapplication            \
138         basic-application       \
139         gdbus-test-codegen      \
140         $(NULL)
141 SAMPLE_PROGS +=                                 \
142         gdbus-example-unix-fd-client            \
143         gdbus-example-objectmanager-server      \
144         gdbus-example-objectmanager-client      \
145         appinfo-test                            \
146         $(NULL)
147 endif
148
149 if OS_WIN32
150 TEST_PROGS += win32-streams
151 endif
152
153 actions_SOURCES   = actions.c gdbus-sessionbus.c gdbus-sessionbus.h
154
155 unix_streams_LDADD       = $(LDADD) \
156         $(top_builddir)/gthread/libgthread-2.0.la
157
158 win32_streams_LDADD      = $(LDADD) \
159         $(top_builddir)/gthread/libgthread-2.0.la
160
161 resolver_LDADD            = $(LDADD) \
162         $(top_builddir)/gthread/libgthread-2.0.la
163
164 socket_server_LDADD       = $(LDADD) \
165         $(top_builddir)/gthread/libgthread-2.0.la
166
167 socket_client_SOURCES     = socket-client.c \
168                             gtlsconsoleinteraction.c \
169                             gtlsconsoleinteraction.h
170 socket_client_LDADD       = $(LDADD) \
171         $(top_builddir)/gthread/libgthread-2.0.la
172
173 echo_server_LDADD         = $(LDADD) \
174         $(top_builddir)/gthread/libgthread-2.0.la
175
176 httpd_LDADD               = $(LDADD) \
177         $(top_builddir)/gthread/libgthread-2.0.la
178
179 send_data_LDADD           = $(LDADD) \
180         $(top_builddir)/gthread/libgthread-2.0.la
181
182 contexts_LDADD            = $(LDADD) \
183         $(top_builddir)/gthread/libgthread-2.0.la
184
185 gdbus_daemon_SOURCES = gdbus-daemon.c $(top_srcdir)/gio/gdbusdaemon.c $(top_builddir)/gio/gdbus-daemon-generated.c
186
187 if HAVE_DBUS1
188 TEST_PROGS += gdbus-serialization
189 gdbus_serialization_SOURCES = gdbus-serialization.c gdbus-tests.h gdbus-tests.c
190 gdbus_serialization_CFLAGS = $(DBUS1_CFLAGS)
191 gdbus_serialization_LDADD = $(LDADD) $(DBUS1_LIBS)
192 endif
193
194 if HAVE_DBUS1
195 TEST_PROGS += gdbus-auth
196 gdbus_auth_SOURCES = gdbus-auth.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
197 gdbus_auth_CFLAGS = $(DBUS1_CFLAGS)
198 gdbus_auth_LDADD = $(LDADD) $(DBUS1_LIBS)
199 endif
200
201 gdbus_bz627724_SOURCES = gdbus-bz627724.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
202
203 gdbus_close_pending_SOURCES = gdbus-close-pending.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
204
205 if OS_UNIX
206 gdbus-test-codegen-generated.h gdbus-test-codegen-generated.c : test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
207         $(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
208                 UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
209                 $(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
210                 --interface-prefix org.project. \
211                 --generate-c-code gdbus-test-codegen-generated \
212                 --c-generate-object-manager \
213                 --c-namespace Foo_iGen \
214                 --generate-docbook gdbus-test-codegen-generated-doc \
215                 --annotate "org.project.Bar" Key1 Value1 \
216                 --annotate "org.project.Bar" org.gtk.GDBus.Internal Value2 \
217                 --annotate "org.project.Bar.HelloWorld()" Key3 Value3 \
218                 --annotate "org.project.Bar::TestSignal" Key4 Value4 \
219                 --annotate "org.project.Bar:ay" Key5 Value5 \
220                 --annotate "org.project.Bar.TestPrimitiveTypes()[val_int32]" Key6 Value6 \
221                 --annotate "org.project.Bar.TestPrimitiveTypes()[ret_uint32]" Key7 Value7 \
222                 --annotate "org.project.Bar::TestSignal[array_of_strings]" Key8 Value8 \
223                 $(srcdir)/test-codegen.xml \
224                 $(NULL)
225
226 BUILT_SOURCES += gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
227
228 gdbus_test_codegen_SOURCES  = gdbus-test-codegen.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
229 gdbus_test_codegen_SOURCES += gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
230
231 endif # OS_UNIX
232
233 gdbus_connection_SOURCES = gdbus-connection.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
234
235 gdbus_connection_flush_SOURCES = \
236         gdbus-connection-flush.c \
237         test-io-stream.c \
238         test-io-stream.h \
239         test-pipe-unix.c \
240         test-pipe-unix.h \
241         $(NULL)
242
243 gdbus_connection_loss_SOURCES = gdbus-connection-loss.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
244
245 gdbus_connection_slow_SOURCES = gdbus-connection-slow.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
246
247 gdbus_names_SOURCES = gdbus-names.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
248
249 gdbus_proxy_SOURCES = gdbus-proxy.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
250
251 gdbus_proxy_threads_SOURCES = gdbus-proxy-threads.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
252
253 gdbus_proxy_well_known_name_SOURCES = gdbus-proxy-well-known-name.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
254
255 gdbus_introspection_SOURCES = gdbus-introspection.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
256
257 gdbus_threading_SOURCES = gdbus-threading.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
258
259 gdbus_export_SOURCES = gdbus-export.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
260
261 gdbus_error_SOURCES = gdbus-error.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
262
263 gdbus_non_socket_SOURCES = \
264         gdbus-non-socket.c \
265         gdbus-tests.c \
266         gdbus-tests.h \
267         test-io-stream.c \
268         test-io-stream.h \
269         test-pipe-unix.c \
270         test-pipe-unix.h \
271         $(NULL)
272
273 gdbus_exit_on_close_SOURCES = gdbus-exit-on-close.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
274
275 resources_SOURCES = resources.c test_resources.c test_resources2.c test_resources2.h
276 resources_DEPENDENCIES = test.gresource
277
278 gapplication_SOURCES = gapplication.c gdbus-sessionbus.h gdbus-sessionbus.c gdbus-tests.h gdbus-tests.c
279
280 gmenumodel_SOURCES = gmenumodel.c gdbus-sessionbus.h gdbus-sessionbus.c
281
282 schema_tests = \
283         schema-tests/array-default-not-in-choices.gschema.xml           \
284         schema-tests/bad-choice.gschema.xml                             \
285         schema-tests/bad-key.gschema.xml                                \
286         schema-tests/bad-key2.gschema.xml                               \
287         schema-tests/bad-key3.gschema.xml                               \
288         schema-tests/bad-key4.gschema.xml                               \
289         schema-tests/bad-type.gschema.xml                               \
290         schema-tests/bare-alias.gschema.xml                             \
291         schema-tests/choice-alias.gschema.xml                           \
292         schema-tests/choice-bad.gschema.xml                             \
293         schema-tests/choice-badtype.gschema.xml                         \
294         schema-tests/choice-invalid-alias.gschema.xml                   \
295         schema-tests/choice-missing-value.gschema.xml                   \
296         schema-tests/choice-shadowed-alias.gschema.xml                  \
297         schema-tests/choice-upside-down.gschema.xml                     \
298         schema-tests/choice.gschema.xml                                 \
299         schema-tests/choices-wrong-type.gschema.xml                     \
300         schema-tests/default-in-aliases.gschema.xml                     \
301         schema-tests/default-not-in-choices.gschema.xml                 \
302         schema-tests/default-out-of-range.gschema.xml                   \
303         schema-tests/empty-key.gschema.xml                              \
304         schema-tests/enum-with-aliases.gschema.xml                      \
305         schema-tests/enum-with-bad-default.gschema.xml                  \
306         schema-tests/enum-with-chained-alias.gschema.xml                \
307         schema-tests/enum-with-choice.gschema.xml                       \
308         schema-tests/enum-with-invalid-alias.gschema.xml                \
309         schema-tests/enum-with-repeated-alias.gschema.xml               \
310         schema-tests/enum-with-repeated-nick.gschema.xml                \
311         schema-tests/enum-with-repeated-value.gschema.xml               \
312         schema-tests/enum-with-shadow-alias.gschema.xml                 \
313         schema-tests/enum.gschema.xml                                   \
314         schema-tests/flags-aliased-default.gschema.xml                  \
315         schema-tests/flags-bad-default.gschema.xml                      \
316         schema-tests/flags-more-than-one-bit.gschema.xml                \
317         schema-tests/flags-with-enum-attr.gschema.xml                   \
318         schema-tests/flags-with-enum-tag.gschema.xml                    \
319         schema-tests/extend-and-shadow-indirect.gschema.xml             \
320         schema-tests/extend-and-shadow.gschema.xml                      \
321         schema-tests/extend-missing.gschema.xml                         \
322         schema-tests/extend-nonlist.gschema.xml                         \
323         schema-tests/extend-self.gschema.xml                            \
324         schema-tests/extend-wrong-list-indirect.gschema.xml             \
325         schema-tests/extend-wrong-list.gschema.xml                      \
326         schema-tests/extending.gschema.xml                              \
327         schema-tests/from-docs.gschema.xml                              \
328         schema-tests/incomplete-list.gschema.xml                        \
329         schema-tests/inherit-gettext-domain.gschema.xml                 \
330         schema-tests/invalid-path.gschema.xml                           \
331         schema-tests/key-in-list-indirect.gschema.xml                   \
332         schema-tests/key-in-list.gschema.xml                            \
333         schema-tests/list-of-missing.gschema.xml                        \
334         schema-tests/missing-quotes.gschema.xml                         \
335         schema-tests/no-default.gschema.xml                             \
336         schema-tests/overflow.gschema.xml                               \
337         schema-tests/override-missing.gschema.xml                       \
338         schema-tests/override-range-error.gschema.xml                   \
339         schema-tests/override-then-key.gschema.xml                      \
340         schema-tests/override-twice.gschema.xml                         \
341         schema-tests/override-type-error.gschema.xml                    \
342         schema-tests/override.gschema.xml                               \
343         schema-tests/range-badtype.gschema.xml                          \
344         schema-tests/range-default-high.gschema.xml                     \
345         schema-tests/range-default-low.gschema.xml                      \
346         schema-tests/range-high-default.gschema.xml                     \
347         schema-tests/range-low-default.gschema.xml                      \
348         schema-tests/range-missing-max.gschema.xml                      \
349         schema-tests/range-missing-min.gschema.xml                      \
350         schema-tests/range-parse-error.gschema.xml                      \
351         schema-tests/range-wrong-type.gschema.xml                       \
352         schema-tests/range.gschema.xml                                  \
353         schema-tests/wrong-category.gschema.xml
354
355 proxy_LDADD   = $(LDADD) \
356         $(top_builddir)/gthread/libgthread-2.0.la
357
358 tls_certificate_SOURCES = tls-certificate.c gtesttlsbackend.c gtesttlsbackend.h
359
360 # -----------------------------------------------------------------------------
361
362 if OS_UNIX
363 gdbus_example_objectmanager_server_CFLAGS   = -I$(top_builddir)/gio/tests/gdbus-object-manager-example
364 gdbus_example_objectmanager_server_LDADD    = $(top_builddir)/gio/tests/gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
365
366 gdbus_example_objectmanager_client_CFLAGS   = -I$(top_builddir)/gio/tests/gdbus-object-manager-example
367 gdbus_example_objectmanager_client_LDADD    = $(top_builddir)/gio/tests/gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
368
369 gdbus_peer_SOURCES = gdbus-peer.c gdbus-tests.h gdbus-tests.c
370 gdbus_peer_CFLAGS  = -I$(top_builddir)/gio/tests/gdbus-object-manager-example
371 gdbus_peer_LDADD   = $(top_builddir)/gio/tests/gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
372
373 endif OS_UNIX
374
375 # -----------------------------------------------------------------------------
376
377 EXTRA_DIST += \
378         socket-common.c                 \
379         org.gtk.test.gschema            \
380         org.gtk.test.gschema.xml        \
381         testenum.h                      \
382         enums.xml.template              \
383         de.po                           \
384         $(schema_tests)                 \
385         org.gtk.schemasourcecheck.gschema.xml \
386         appinfo-test.desktop            \
387         appinfo-test2.desktop           \
388         appinfo-test-gnome.desktop      \
389         appinfo-test-notgnome.desktop   \
390         gdbus-testserver.py             \
391         test-codegen.xml                \
392         cert1.pem                       \
393         cert2.pem                       \
394         cert3.pem                       \
395         key.pem                         \
396         key8.pem                        \
397         key-cert.pem                    \
398         cert-key.pem                    \
399         cert-list.pem                   \
400         nothing.pem                     \
401         test.gresource.xml              \
402         test1.txt                       \
403         test2.gresource.xml             \
404         test2.txt                       \
405         test3.gresource.xml             \
406         test3.txt                       \
407         test4.gresource.xml             \
408         $(NULL)
409
410 MISC_STUFF = test.mo test.gresource
411
412 test.mo: de.po
413         $(MSGFMT) -o test.mo $(srcdir)/de.po; \
414         $(MKDIR_P) de/LC_MESSAGES; \
415         cp -f test.mo de/LC_MESSAGES
416
417 if CROSS_COMPILING
418   glib_compile_resources=$(GLIB_COMPILE_RESOURCES)
419 else
420   glib_compile_resources=$(top_builddir)/gio/glib-compile-resources
421 endif
422
423 BUILT_SOURCES += test_resources.c test_resources2.c test_resources2.h
424 test_resources.c: test2.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test2.gresource.xml)
425         $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate-source --c-name _g_test1 $<
426
427 test_resources2.h test_resources2.c: test3.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test3.gresource.xml)
428         $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate --c-name _g_test2 --manual-register $<
429
430 plugin_resources.c: test4.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test4.gresource.xml)
431         $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate-source --c-name _g_plugin $<
432
433 test.gresource: test.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test.gresource.xml)
434         $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) $<
435
436 noinst_LTLIBRARIES = libresourceplugin.la
437
438 libresourceplugin_la_SOURCES = resourceplugin.c plugin_resources.c
439 libresourceplugin_la_LDFLAGS = -avoid-version -module $(no_undefined) -rpath $(libdir)
440 libresourceplugin_la_LIBADD = $(LDADD)
441
442 CLEANFILES = gdbus-test-codegen-generated.[ch] gdbus-test-codegen-generated-doc-*.xml test_resources2.[ch] plugin_resources.c
443
444 DISTCLEANFILES = \
445         applications/mimeinfo.cache     \
446         org.gtk.test.enums.xml          \
447         de/LC_MESSAGES/test.mo          \
448         test.mo                         \
449         test.gresource                  \
450         test_resources.c                \
451         gsettings.store                 \
452         gschemas.compiled               \
453         schema-source/gschemas.compiled
454
455 distclean-local:
456         rm -rf xdgdatahome xdgdatadir