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