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