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