1 include $(top_srcdir)/glib-tap.mk
3 dist_uninstalled_test_data =
6 SUBDIRS = gdbus-object-manager-example services modules
9 $(top_builddir)/gio/libgio-2.0.la \
10 $(top_builddir)/gobject/libgobject-2.0.la \
11 $(top_builddir)/gmodule/libgmodule-2.0.la \
12 $(top_builddir)/glib/libglib-2.0.la \
15 AM_CPPFLAGS = $(gio_INCLUDES) $(GLIB_DEBUG_FLAGS) -I$(top_builddir)/gio -I$(top_srcdir)/gio
16 DEFS = -DG_LOG_DOMAIN=\"GLib-GIO\" -DTEST_SERVICES=\""$(abs_top_builddir)/gio/tests/services"\"
17 AM_CFLAGS = $(GLIB_WARN_CFLAGS)
18 AM_TESTS_ENVIRONMENT += GIO_MODULE_DIR=
20 # -----------------------------------------------------------------------------
21 # Test programs buildable on all platforms
25 async-close-output-stream \
26 async-splice-output-stream \
27 buffered-input-stream \
28 buffered-output-stream \
36 fileattributematcher \
48 memory-output-stream \
52 network-monitor-race \
72 uninstalled_test_programs = \
83 uninstalled_test_extra_programs = \
87 gapplication-example-actions \
88 gapplication-example-cmdline \
89 gapplication-example-cmdline2 \
90 gapplication-example-cmdline3 \
91 gapplication-example-cmdline4 \
92 gapplication-example-dbushooks \
93 gapplication-example-open \
94 gdbus-example-export \
95 gdbus-example-own-name \
97 gdbus-example-proxy-subclass \
98 gdbus-example-server \
99 gdbus-example-subtree \
100 gdbus-example-watch-name \
101 gdbus-example-watch-proxy \
102 gsubprocess-testprog \
110 test_extra_programs = \
111 gdbus-connection-flush-helper \
115 dist_uninstalled_test_data += $(addprefix schema-tests/,$(schema_tests))
117 array-default-not-in-choices.gschema.xml \
118 bad-choice.gschema.xml \
119 bad-key.gschema.xml \
120 bad-key2.gschema.xml \
121 bad-key3.gschema.xml \
122 bad-key4.gschema.xml \
123 bad-type.gschema.xml \
124 bare-alias.gschema.xml \
125 choice-alias.gschema.xml \
126 choice-bad.gschema.xml \
127 choice-badtype.gschema.xml \
128 choice-invalid-alias.gschema.xml \
129 choice-missing-value.gschema.xml \
130 choice-shadowed-alias.gschema.xml \
131 choice-upside-down.gschema.xml \
133 choices-wrong-type.gschema.xml \
134 default-in-aliases.gschema.xml \
135 default-not-in-choices.gschema.xml \
136 default-out-of-range.gschema.xml \
137 description-xmllang.gschema.xml \
138 empty-key.gschema.xml \
139 enum-with-aliases.gschema.xml \
140 enum-with-bad-default.gschema.xml \
141 enum-with-chained-alias.gschema.xml \
142 enum-with-choice.gschema.xml \
143 enum-with-invalid-alias.gschema.xml \
144 enum-with-invalid-value.gschema.xml \
145 enum-with-repeated-alias.gschema.xml \
146 enum-with-repeated-nick.gschema.xml \
147 enum-with-repeated-value.gschema.xml \
148 enum-with-shadow-alias.gschema.xml \
150 extend-and-shadow-indirect.gschema.xml \
151 extend-and-shadow.gschema.xml \
152 extend-missing.gschema.xml \
153 extend-nonlist.gschema.xml \
154 extend-self.gschema.xml \
155 extend-wrong-list-indirect.gschema.xml \
156 extend-wrong-list.gschema.xml \
157 extending.gschema.xml \
158 flags-aliased-default.gschema.xml \
159 flags-bad-default.gschema.xml \
160 flags-more-than-one-bit.gschema.xml \
161 flags-with-enum-attr.gschema.xml \
162 flags-with-enum-tag.gschema.xml \
163 from-docs.gschema.xml \
164 incomplete-list.gschema.xml \
165 inherit-gettext-domain.gschema.xml \
166 invalid-path.gschema.xml \
167 key-in-list-indirect.gschema.xml \
168 key-in-list.gschema.xml \
169 list-of-missing.gschema.xml \
170 missing-quotes.gschema.xml \
171 no-default.gschema.xml \
172 overflow.gschema.xml \
173 override-missing.gschema.xml \
174 override-range-error.gschema.xml \
175 override-then-key.gschema.xml \
176 override-twice.gschema.xml \
177 override-type-error.gschema.xml \
178 override.gschema.xml \
179 range-badtype.gschema.xml \
180 range-default-high.gschema.xml \
181 range-default-low.gschema.xml \
182 range-high-default.gschema.xml \
183 range-low-default.gschema.xml \
184 range-missing-max.gschema.xml \
185 range-missing-min.gschema.xml \
186 range-parse-error.gschema.xml \
187 range-wrong-type.gschema.xml \
189 summary-xmllang.gschema.xml \
190 summary-xmllang-and-attrs.gschema.xml \
191 wrong-category.gschema.xml \
194 test_programs += thumbnail-verification
195 dist_test_data += $(thumbnail_data_files)
196 thumbnail_data_files = $(addprefix thumbnails/,$(thumbnail_tests))
200 header-and-chunk-size.png \
202 huge-chunk-size.png \
211 test_programs += tls-certificate
212 tls_certificate_SOURCES = \
216 dist_test_data += $(cert_data_files)
217 cert_data_files = $(addprefix cert-tests/,$(cert_tests))
230 uninstalled_test_extra_programs += socket-client
231 socket_client_SOURCES = \
233 gtlsconsoleinteraction.c \
234 gtlsconsoleinteraction.h
235 EXTRA_DIST += socket-common.c
237 uninstalled_test_extra_programs += gdbus-daemon
238 gdbus_daemon_SOURCES = gdbus-daemon.c
239 nodist_gdbus_daemon_SOURCES = \
240 gdbus-daemon-generated.c \
242 CLEANFILES += gdbus-daemon-impl.c gdbus-daemon-generated.c gdbus-daemon-generated.h
244 # With subdir-objects we need to create a link to the original
245 # file in the right directory, otherwise libtool will complain
246 # that it cannot find the wrapper file
247 gdbus-daemon-impl.c: $(top_srcdir)/gio/gdbusdaemon.c
248 $(AM_V_GEN) $(LN_S) $^ $@
250 # These files are only generated on Windows builds inside GIO,
251 # but we want them on non-Windows builds for the tests
252 gdbus-daemon-generated.h gdbus-daemon-generated.c: $(top_srcdir)/gio/dbus-daemon.xml $(GDBUS_PYTHON_DEPS)
253 $(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
254 UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
255 $(PYTHON) $(top_srcdir)/gio/gdbus-2.0/codegen/gdbus-codegen.in \
256 --interface-prefix org. \
257 --generate-c-code gdbus-daemon-generated \
259 $(top_srcdir)/gio/dbus-daemon.xml \
262 # -----------------------------------------------------------------------------
263 # Test programs buildable on UNIX only
268 gdbus-peer-object-manager \
275 g-file-info-filesystem-readonly \
278 test_extra_programs += \
284 # Uninstalled because of the check-for-executable logic in DesktopAppInfo unable to find the installed executable
285 uninstalled_test_programs += \
291 home_desktop_files = \
292 epiphany-weather-for-toronto-island-9c6a4e022b17686306243dada811d550d25eb1fb.desktop \
295 usr_desktop_files = \
298 dconf-editor.desktop \
300 evince-previewer.desktop \
302 file-roller.desktop \
303 frobnicator.desktop \
304 gcr-prompter.desktop \
308 gnome-contacts.desktop \
309 gnome-font-viewer.desktop \
310 gnome-music.desktop \
311 gnome-terminal.desktop \
313 kde4/dolphin.desktop \
315 kde4/konqbrowser.desktop \
316 kde4/okular.desktop \
318 nautilus-autorun-software.desktop \
319 nautilus-classic.desktop \
320 nautilus-connect-server.desktop \
322 org.gnome.clocks.desktop \
327 $(addprefix desktop-files/usr/applications/,$(usr_desktop_files)) \
328 $(addprefix desktop-files/home/applications/,$(home_desktop_files))
331 appinfo-test-actions.desktop \
332 appinfo-test-gnome.desktop \
333 appinfo-test-notgnome.desktop \
334 appinfo-test.desktop \
335 appinfo-test2.desktop \
337 org.gtk.test.dbusappinfo.desktop \
338 x-content/image-dcf/DCIM/Camera/20130831_203925.jpg \
339 x-content/image-dcf/DCIM/Camera/20130831_203928.jpg \
340 x-content/unix-software/autorun.sh \
341 x-content/win32-software/autorun.exe \
344 test_extra_programs += \
348 uninstalled_test_extra_programs += \
349 gdbus-example-unix-fd-client \
353 test_extra_programs += apps
354 test_programs += mimeapps
355 clean-local: clean-mimeapps
357 rm -rf xdgdatadir xdgdatahome xdgconfighome
360 uninstalled_test_programs += gsettings gschema-compile
361 gsettings_DEPENDENCIES = test.mo
362 CLEANFILES += test.mo de/LC_MESSAGES/test.mo keyfile/gsettings.store
363 gsettings_CFLAGS = $(AM_CFLAGS) -DSRCDIR=\"$(abs_srcdir)\"
365 $(AM_V_GEN) $(MSGFMT) -o test.mo $(srcdir)/de.po; \
366 $(MKDIR_P) de/LC_MESSAGES; \
367 cp -f test.mo de/LC_MESSAGES
369 dist_uninstalled_test_data += \
370 org.gtk.test.gschema.xml.orig \
371 org.gtk.schemasourcecheck.gschema.xml \
374 # Generated while running the testcase itself...
376 org.gtk.test.gschema.xml \
377 org.gtk.test.enums.xml \
380 schema-source/gschemas.compiled
382 test_programs += gdbus-connection-flush
383 gdbus_connection_flush_SOURCES = \
384 gdbus-connection-flush.c \
390 test_programs += gdbus-non-socket
391 gdbus_non_socket_SOURCES = \
400 # These three are manual-run tests because they need a session bus but don't bring one up themselves
401 uninstalled_test_extra_programs += gdbus-example-objectmanager-client
402 gdbus_example_objectmanager_client_LDADD = gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
404 uninstalled_test_extra_programs += gdbus-example-objectmanager-server
405 gdbus_example_objectmanager_server_LDADD = gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
407 test_extra_programs += gsubprocess-testprog
409 uninstalled_test_extra_programs += gdbus-test-fixture
410 gdbus_test_fixture_LDADD = gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
412 # This is peer to peer so it doesn't need a session bus (so we can run it normally)
413 gdbus_peer_LDADD = gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
415 # This test is currently unreliable
416 test_extra_programs += gdbus-overflow
418 # -----------------------------------------------------------------------------
419 # Test programs that need to bring up a session bus (requires dbus-daemon)
422 gdbus_sessionbus_sources = gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
430 gdbus-close-pending \
432 gdbus-connection-loss \
433 gdbus-connection-slow \
435 gdbus-exit-on-close \
437 gdbus-introspection \
441 gdbus-proxy-threads \
442 gdbus-proxy-well-known-name \
444 gdbus-test-codegen-old \
451 test_programs += gdbus-unix-addresses
454 test_programs += dbus-appinfo
459 gdbus_proxy_threads_CFLAGS = $(AM_CFLAGS) $(DBUS1_CFLAGS)
460 actions_SOURCES = $(gdbus_sessionbus_sources) actions.c
461 dbus_appinfo_SOURCES = $(gdbus_sessionbus_sources) dbus-appinfo.c
462 gapplication_SOURCES = $(gdbus_sessionbus_sources) gapplication.c
463 gdbus_auth_SOURCES = $(gdbus_sessionbus_sources) gdbus-auth.c
464 gdbus_bz627724_SOURCES = $(gdbus_sessionbus_sources) gdbus-bz627724.c
465 gdbus_close_pending_SOURCES = $(gdbus_sessionbus_sources) gdbus-close-pending.c
466 gdbus_connection_SOURCES = $(gdbus_sessionbus_sources) gdbus-connection.c
467 gdbus_connection_loss_SOURCES = $(gdbus_sessionbus_sources) gdbus-connection-loss.c
468 gdbus_connection_slow_SOURCES = $(gdbus_sessionbus_sources) gdbus-connection-slow.c
469 gdbus_error_SOURCES = $(gdbus_sessionbus_sources) gdbus-error.c
470 gdbus_exit_on_close_SOURCES = $(gdbus_sessionbus_sources) gdbus-exit-on-close.c
471 gdbus_export_SOURCES = $(gdbus_sessionbus_sources) gdbus-export.c
472 gdbus_introspection_SOURCES = $(gdbus_sessionbus_sources) gdbus-introspection.c
473 gdbus_names_SOURCES = $(gdbus_sessionbus_sources) gdbus-names.c
474 gdbus_proxy_SOURCES = $(gdbus_sessionbus_sources) gdbus-proxy.c
475 gdbus_proxy_threads_SOURCES = $(gdbus_sessionbus_sources) gdbus-proxy-threads.c
476 gdbus_proxy_well_known_name_SOURCES = $(gdbus_sessionbus_sources) gdbus-proxy-well-known-name.c
477 gdbus_test_codegen_SOURCES = $(gdbus_sessionbus_sources) gdbus-test-codegen.c
478 nodist_gdbus_test_codegen_SOURCES = gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
479 gdbus_test_codegen_old_SOURCES = $(gdbus_sessionbus_sources) gdbus-test-codegen.c
480 nodist_gdbus_test_codegen_old_SOURCES = gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
481 gdbus_test_codegen_old_CPPFLAGS = $(AM_CPPFLAGS) -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36
482 gdbus_threading_SOURCES = $(gdbus_sessionbus_sources) gdbus-threading.c
483 gmenumodel_SOURCES = $(gdbus_sessionbus_sources) gmenumodel.c
484 gnotification_SOURCES = $(gdbus_sessionbus_sources) gnotification.c gnotification-server.h gnotification-server.c
486 BUILT_SOURCES += gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
487 gdbus-test-codegen.o: gdbus-test-codegen-generated.h
488 gdbus-test-codegen-generated.h: test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
489 $(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
490 UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
491 $(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
492 --interface-prefix org.project. \
493 --generate-c-code gdbus-test-codegen-generated \
494 --c-generate-object-manager \
495 --c-namespace Foo_iGen \
496 --generate-docbook gdbus-test-codegen-generated-doc \
497 --annotate "org.project.Bar" Key1 Value1 \
498 --annotate "org.project.Bar" org.gtk.GDBus.Internal Value2 \
499 --annotate "org.project.Bar.HelloWorld()" Key3 Value3 \
500 --annotate "org.project.Bar::TestSignal" Key4 Value4 \
501 --annotate "org.project.Bar:ay" Key5 Value5 \
502 --annotate "org.project.Bar.TestPrimitiveTypes()[val_int32]" Key6 Value6 \
503 --annotate "org.project.Bar.TestPrimitiveTypes()[ret_uint32]" Key7 Value7 \
504 --annotate "org.project.Bar::TestSignal[array_of_strings]" Key8 Value8 \
505 $(srcdir)/test-codegen.xml \
507 gdbus-test-codegen-generated.c: gdbus-test-codegen-generated.h
508 @: # Generated as side-effect of .h
510 EXTRA_DIST += test-codegen.xml
511 CLEANFILES += gdbus-test-codegen-generated.[ch] gdbus-test-codegen-generated-doc-*.xml
513 endif # HAVE_DBUS_DAEMON
515 tls_interaction_SOURCES = tls-interaction.c gtesttlsbackend.c gtesttlsbackend.h
517 # -----------------------------------------------------------------------------
520 test_programs += win32-streams
524 no_undefined = -no-undefined
528 test_programs += gdbus-serialization
529 gdbus_serialization_CFLAGS = $(AM_CFLAGS) $(DBUS1_CFLAGS)
530 gdbus_serialization_LDADD = $(LDADD) $(DBUS1_LIBS)
531 gdbus_serialization_SOURCES = \
532 gdbus-serialization.c \
543 # -----------------------------------------------------------------------------
544 # The resources test is a bit more complicated, and we cannot build it when
545 # cross-compiling GIO because it requires running a binary...
548 test_programs += resources
549 resources_SOURCES = resources.c
550 nodist_resources_SOURCES = test_resources.c test_resources2.c test_resources2.h
551 resources_DEPENDENCIES = test.gresource
553 test_ltlibraries += libresourceplugin.la
554 libresourceplugin_la_SOURCES = resourceplugin.c plugin_resources.c
555 libresourceplugin_la_LDFLAGS = -avoid-version -module -export-dynamic $(no_undefined)
556 libresourceplugin_la_LIBADD = $(LDADD)
558 test_data += test.gresource
560 # libtool contains a bug whereby the created .la file doesn't contain the correct dlname='' in the case that
561 # you're building a library but not installing it. This is apparently because the only considered use for an
562 # uninstalled library is as a convenience library for linking (despite the fact that we give -module). The lack
563 # of dlname='' in the .la trips up libltdl and GModule as well. We can trick libtool into believing that we
564 # will install the module by giving it a bogus -rpath for the uninstalled cases.
566 # See http://lists.gnu.org/archive/html/bug-libtool/2013-05/msg00009.html
567 if !ENABLE_INSTALLED_TESTS
568 libresourceplugin_la_LDFLAGS += -rpath /
571 glib_compile_resources=$(top_builddir)/gio/glib-compile-resources
573 test-generated.txt: test1.txt
574 $(AM_V_GEN) echo "Generated" > $@ && \
577 resources.o: test_resources2.h
578 test_resources.c: test2.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test2.gresource.xml)
579 $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate-source --c-name _g_test1 $<
581 test_resources2.h test_resources2.c: test3.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test3.gresource.xml)
582 $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate --c-name _g_test2 --manual-register $<
584 plugin_resources.c: test4.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test4.gresource.xml)
585 $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate-source --c-name _g_plugin $<
587 test.gresource: test.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=. --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test.gresource.xml)
588 $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=. --sourcedir=$(srcdir) $<
590 EXTRA_DIST += test.gresource.xml test1.txt test2.gresource.xml test2.txt test3.gresource.xml test3.txt test4.gresource.xml
591 CLEANFILES += test-generated.txt test_resources.c test_resources2.[ch] plugin_resources.c test.gresource
592 endif # !CROSS_COMPILING
594 BUILT_SOURCES += giotypefuncs.inc
596 giotypefuncs.inc: Makefile
597 $(AM_V_GEN) echo '#include <gio/gio.h>' > xgen-giosrc.c && \
598 echo "G_GNUC_BEGIN_IGNORE_DEPRECATIONS" > xgen-gio && \
599 ${CPP} $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) xgen-giosrc.c | \
600 $(GREP) -o '\bg_[A-Za-z0-9_]*_get_type\b' | \
601 $(GREP) -v 'g_io_extension_get_type\|g_variant_get_type' | \
602 LC_ALL=C sort | uniq | \
603 $(SED) -e 's/^/*tp++ = /' -e 's/$$/ ();/' >> xgen-gio && \
604 cp xgen-gio $@ # && rm -f xgen-gio xgen-giosrc.c
606 CLEANFILES += xgen-giosrc.c xgen-gio giotypefuncs.inc
608 if ENABLE_INSTALLED_TESTS
611 $(AM_V_at) chmod a+x $(DESTDIR)$(installed_testdir)/x-content/win32-software/autorun.exe