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 += \
20 GIO_LAUNCH_DESKTOP="$(top_builddir)/gio/gio-launch-desktop"
22 # -----------------------------------------------------------------------------
23 # Test programs buildable on all platforms
27 async-close-output-stream \
28 async-splice-output-stream \
29 buffered-input-stream \
30 buffered-output-stream \
38 fileattributematcher \
50 memory-output-stream \
55 network-monitor-race \
75 uninstalled_test_programs = \
86 uninstalled_test_extra_programs = \
90 gapplication-example-actions \
91 gapplication-example-cmdline \
92 gapplication-example-cmdline2 \
93 gapplication-example-cmdline3 \
94 gapplication-example-cmdline4 \
95 gapplication-example-dbushooks \
96 gapplication-example-open \
97 gdbus-example-export \
98 gdbus-example-own-name \
100 gdbus-example-proxy-subclass \
101 gdbus-example-server \
102 gdbus-example-subtree \
103 gdbus-example-watch-name \
104 gdbus-example-watch-proxy \
105 gsubprocess-testprog \
113 test_extra_programs = \
114 gdbus-connection-flush-helper \
118 dist_uninstalled_test_data += $(addprefix schema-tests/,$(schema_tests))
120 array-default-not-in-choices.gschema.xml \
121 bad-choice.gschema.xml \
122 bad-key.gschema.xml \
123 bad-key2.gschema.xml \
124 bad-key3.gschema.xml \
125 bad-key4.gschema.xml \
126 bad-type.gschema.xml \
127 bare-alias.gschema.xml \
128 choice-alias.gschema.xml \
129 choice-bad.gschema.xml \
130 choice-badtype.gschema.xml \
131 choice-invalid-alias.gschema.xml \
132 choice-missing-value.gschema.xml \
133 choice-shadowed-alias.gschema.xml \
134 choice-upside-down.gschema.xml \
136 choices-wrong-type.gschema.xml \
137 default-in-aliases.gschema.xml \
138 default-not-in-choices.gschema.xml \
139 default-out-of-range.gschema.xml \
140 description-xmllang.gschema.xml \
141 empty-key.gschema.xml \
142 enum-with-aliases.gschema.xml \
143 enum-with-bad-default.gschema.xml \
144 enum-with-chained-alias.gschema.xml \
145 enum-with-choice.gschema.xml \
146 enum-with-invalid-alias.gschema.xml \
147 enum-with-invalid-value.gschema.xml \
148 enum-with-repeated-alias.gschema.xml \
149 enum-with-repeated-nick.gschema.xml \
150 enum-with-repeated-value.gschema.xml \
151 enum-with-shadow-alias.gschema.xml \
153 extend-and-shadow-indirect.gschema.xml \
154 extend-and-shadow.gschema.xml \
155 extend-missing.gschema.xml \
156 extend-nonlist.gschema.xml \
157 extend-self.gschema.xml \
158 extend-wrong-list-indirect.gschema.xml \
159 extend-wrong-list.gschema.xml \
160 extending.gschema.xml \
161 flags-aliased-default.gschema.xml \
162 flags-bad-default.gschema.xml \
163 flags-more-than-one-bit.gschema.xml \
164 flags-with-enum-attr.gschema.xml \
165 flags-with-enum-tag.gschema.xml \
166 from-docs.gschema.xml \
167 incomplete-list.gschema.xml \
168 inherit-gettext-domain.gschema.xml \
169 invalid-path.gschema.xml \
170 key-in-list-indirect.gschema.xml \
171 key-in-list.gschema.xml \
172 list-of-missing.gschema.xml \
173 missing-quotes.gschema.xml \
174 no-default.gschema.xml \
175 overflow.gschema.xml \
176 override-missing.gschema.xml \
177 override-range-error.gschema.xml \
178 override-then-key.gschema.xml \
179 override-twice.gschema.xml \
180 override-type-error.gschema.xml \
181 override.gschema.xml \
182 range-badtype.gschema.xml \
183 range-default-high.gschema.xml \
184 range-default-low.gschema.xml \
185 range-high-default.gschema.xml \
186 range-low-default.gschema.xml \
187 range-missing-max.gschema.xml \
188 range-missing-min.gschema.xml \
189 range-parse-error.gschema.xml \
190 range-wrong-type.gschema.xml \
192 summary-xmllang.gschema.xml \
193 summary-xmllang-and-attrs.gschema.xml \
194 wrong-category.gschema.xml \
197 test_programs += thumbnail-verification
198 dist_test_data += $(thumbnail_data_files)
199 thumbnail_data_files = $(addprefix thumbnails/,$(thumbnail_tests))
203 header-and-chunk-size.png \
205 huge-chunk-size.png \
214 test_programs += tls-certificate
215 tls_certificate_SOURCES = \
219 dist_test_data += $(cert_data_files)
220 cert_data_files = $(addprefix cert-tests/,$(cert_tests))
233 uninstalled_test_extra_programs += socket-client
234 socket_client_SOURCES = \
236 gtlsconsoleinteraction.c \
237 gtlsconsoleinteraction.h
238 EXTRA_DIST += socket-common.c
240 uninstalled_test_extra_programs += gdbus-daemon
241 gdbus_daemon_SOURCES = gdbus-daemon.c
242 nodist_gdbus_daemon_SOURCES = \
243 gdbus-daemon-generated.c \
245 CLEANFILES += gdbus-daemon-impl.c gdbus-daemon-generated.c gdbus-daemon-generated.h
247 # With subdir-objects we need to create a link to the original
248 # file in the right directory, otherwise libtool will complain
249 # that it cannot find the wrapper file
250 gdbus-daemon-impl.c: $(top_srcdir)/gio/gdbusdaemon.c
251 $(AM_V_GEN) $(LN_S) $^ $@
253 # These files are only generated on Windows builds inside GIO,
254 # but we want them on non-Windows builds for the tests
255 gdbus-daemon-generated.h gdbus-daemon-generated.c: $(top_srcdir)/gio/dbus-daemon.xml $(GDBUS_PYTHON_DEPS)
256 $(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
257 UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
258 $(PYTHON) $(top_srcdir)/gio/gdbus-2.0/codegen/gdbus-codegen.in \
259 --interface-prefix org. \
260 --generate-c-code gdbus-daemon-generated \
262 $(top_srcdir)/gio/dbus-daemon.xml \
265 # -----------------------------------------------------------------------------
266 # Test programs buildable on UNIX only
271 gdbus-peer-object-manager \
278 g-file-info-filesystem-readonly \
282 test_extra_programs += \
288 # Uninstalled because of the check-for-executable logic in DesktopAppInfo unable to find the installed executable
289 uninstalled_test_programs += \
295 home_desktop_files = \
296 epiphany-weather-for-toronto-island-9c6a4e022b17686306243dada811d550d25eb1fb.desktop \
299 usr_desktop_files = \
302 dconf-editor.desktop \
304 evince-previewer.desktop \
306 file-roller.desktop \
307 frobnicator.desktop \
308 gcr-prompter.desktop \
312 gnome-contacts.desktop \
313 gnome-font-viewer.desktop \
314 gnome-music.desktop \
315 gnome-terminal.desktop \
317 kde4/dolphin.desktop \
319 kde4/konqbrowser.desktop \
320 kde4/okular.desktop \
322 nautilus-autorun-software.desktop \
323 nautilus-classic.desktop \
324 nautilus-connect-server.desktop \
326 org.gnome.clocks.desktop \
331 $(addprefix desktop-files/usr/applications/,$(usr_desktop_files)) \
332 $(addprefix desktop-files/home/applications/,$(home_desktop_files))
335 appinfo-test-actions.desktop \
336 appinfo-test-gnome.desktop \
337 appinfo-test-notgnome.desktop \
338 appinfo-test.desktop \
339 appinfo-test2.desktop \
341 org.gtk.test.dbusappinfo.desktop \
342 x-content/image-dcf/DCIM/Camera/20130831_203925.jpg \
343 x-content/image-dcf/DCIM/Camera/20130831_203928.jpg \
344 x-content/unix-software/autorun.sh \
345 x-content/win32-software/autorun.exe \
348 test_extra_programs += \
352 uninstalled_test_extra_programs += \
353 gdbus-example-unix-fd-client \
357 test_extra_programs += apps
358 test_programs += mimeapps
359 clean-local: clean-mimeapps
361 rm -rf xdgdatadir xdgdatahome xdgconfighome
364 uninstalled_test_programs += gsettings gschema-compile
365 gsettings_DEPENDENCIES = test.mo
366 CLEANFILES += test.mo de/LC_MESSAGES/test.mo keyfile/gsettings.store
367 gsettings_CFLAGS = $(AM_CFLAGS) -DSRCDIR=\"$(abs_srcdir)\"
369 $(AM_V_GEN) $(MSGFMT) -o test.mo $(srcdir)/de.po; \
370 $(MKDIR_P) de/LC_MESSAGES; \
371 cp -f test.mo de/LC_MESSAGES
373 dist_uninstalled_test_data += \
374 org.gtk.test.gschema.xml.orig \
375 org.gtk.test.gschema.override.orig \
376 org.gtk.schemasourcecheck.gschema.xml \
379 # Generated while running the testcase itself...
381 org.gtk.test.gschema.xml \
382 org.gtk.test.gschema.override \
383 org.gtk.test.enums.xml \
386 schema-source/gschemas.compiled
388 test_programs += gdbus-connection-flush
389 gdbus_connection_flush_SOURCES = \
390 gdbus-connection-flush.c \
396 test_programs += gdbus-non-socket
397 gdbus_non_socket_SOURCES = \
406 # These three are manual-run tests because they need a session bus but don't bring one up themselves
407 uninstalled_test_extra_programs += gdbus-example-objectmanager-client
408 gdbus_example_objectmanager_client_LDADD = gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
410 uninstalled_test_extra_programs += gdbus-example-objectmanager-server
411 gdbus_example_objectmanager_server_LDADD = gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
413 test_extra_programs += gsubprocess-testprog
415 uninstalled_test_extra_programs += gdbus-test-fixture
416 gdbus_test_fixture_LDADD = gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
418 # This is peer to peer so it doesn't need a session bus (so we can run it normally)
419 gdbus_peer_LDADD = gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
421 # This test is currently unreliable
422 test_extra_programs += gdbus-overflow
424 # -----------------------------------------------------------------------------
425 # Test programs that need to bring up a session bus (requires dbus-daemon)
428 gdbus_sessionbus_sources = gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
436 gdbus-close-pending \
438 gdbus-connection-loss \
439 gdbus-connection-slow \
441 gdbus-exit-on-close \
443 gdbus-introspection \
447 gdbus-proxy-threads \
448 gdbus-proxy-well-known-name \
450 gdbus-test-codegen-old \
457 test_programs += gdbus-unix-addresses
460 test_programs += dbus-appinfo
465 gdbus_proxy_threads_CFLAGS = $(AM_CFLAGS) $(DBUS1_CFLAGS)
466 actions_SOURCES = $(gdbus_sessionbus_sources) actions.c
467 dbus_appinfo_SOURCES = $(gdbus_sessionbus_sources) dbus-appinfo.c
468 gapplication_SOURCES = $(gdbus_sessionbus_sources) gapplication.c
469 gdbus_auth_SOURCES = $(gdbus_sessionbus_sources) gdbus-auth.c
470 gdbus_bz627724_SOURCES = $(gdbus_sessionbus_sources) gdbus-bz627724.c
471 gdbus_close_pending_SOURCES = $(gdbus_sessionbus_sources) gdbus-close-pending.c
472 gdbus_connection_SOURCES = $(gdbus_sessionbus_sources) gdbus-connection.c
473 gdbus_connection_loss_SOURCES = $(gdbus_sessionbus_sources) gdbus-connection-loss.c
474 gdbus_connection_slow_SOURCES = $(gdbus_sessionbus_sources) gdbus-connection-slow.c
475 gdbus_error_SOURCES = $(gdbus_sessionbus_sources) gdbus-error.c
476 gdbus_exit_on_close_SOURCES = $(gdbus_sessionbus_sources) gdbus-exit-on-close.c
477 gdbus_export_SOURCES = $(gdbus_sessionbus_sources) gdbus-export.c
478 gdbus_introspection_SOURCES = $(gdbus_sessionbus_sources) gdbus-introspection.c
479 gdbus_names_SOURCES = $(gdbus_sessionbus_sources) gdbus-names.c
480 gdbus_proxy_SOURCES = $(gdbus_sessionbus_sources) gdbus-proxy.c
481 gdbus_proxy_threads_SOURCES = $(gdbus_sessionbus_sources) gdbus-proxy-threads.c
482 gdbus_proxy_well_known_name_SOURCES = $(gdbus_sessionbus_sources) gdbus-proxy-well-known-name.c
483 gdbus_test_codegen_SOURCES = $(gdbus_sessionbus_sources) gdbus-test-codegen.c
484 nodist_gdbus_test_codegen_SOURCES = gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
485 gdbus_test_codegen_old_SOURCES = $(gdbus_sessionbus_sources) gdbus-test-codegen.c
486 nodist_gdbus_test_codegen_old_SOURCES = gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
487 gdbus_test_codegen_old_CPPFLAGS = $(AM_CPPFLAGS) -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36
488 gdbus_threading_SOURCES = $(gdbus_sessionbus_sources) gdbus-threading.c
489 gmenumodel_SOURCES = $(gdbus_sessionbus_sources) gmenumodel.c
490 gnotification_SOURCES = $(gdbus_sessionbus_sources) gnotification.c gnotification-server.h gnotification-server.c
492 BUILT_SOURCES += gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
493 gdbus-test-codegen.o: gdbus-test-codegen-generated.h
494 gdbus-test-codegen-generated.h: test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
495 $(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
496 UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
497 $(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
498 --interface-prefix org.project. \
499 --generate-c-code gdbus-test-codegen-generated \
500 --c-generate-object-manager \
501 --c-namespace Foo_iGen \
502 --generate-docbook gdbus-test-codegen-generated-doc \
503 --annotate "org.project.Bar" Key1 Value1 \
504 --annotate "org.project.Bar" org.gtk.GDBus.Internal Value2 \
505 --annotate "org.project.Bar.HelloWorld()" Key3 Value3 \
506 --annotate "org.project.Bar::TestSignal" Key4 Value4 \
507 --annotate "org.project.Bar:ay" Key5 Value5 \
508 --annotate "org.project.Bar.TestPrimitiveTypes()[val_int32]" Key6 Value6 \
509 --annotate "org.project.Bar.TestPrimitiveTypes()[ret_uint32]" Key7 Value7 \
510 --annotate "org.project.Bar::TestSignal[array_of_strings]" Key8 Value8 \
511 $(srcdir)/test-codegen.xml \
513 gdbus-test-codegen-generated.c: gdbus-test-codegen-generated.h
514 @: # Generated as side-effect of .h
516 EXTRA_DIST += test-codegen.xml
517 CLEANFILES += gdbus-test-codegen-generated.[ch] gdbus-test-codegen-generated-doc-*.xml
519 endif # HAVE_DBUS_DAEMON
521 tls_interaction_SOURCES = tls-interaction.c gtesttlsbackend.c gtesttlsbackend.h
523 # -----------------------------------------------------------------------------
526 test_programs += win32-streams
530 no_undefined = -no-undefined
534 test_programs += gdbus-serialization
535 gdbus_serialization_CFLAGS = $(AM_CFLAGS) $(DBUS1_CFLAGS)
536 gdbus_serialization_LDADD = $(LDADD) $(DBUS1_LIBS)
537 gdbus_serialization_SOURCES = \
538 gdbus-serialization.c \
549 # -----------------------------------------------------------------------------
550 # The resources test is a bit more complicated, and we cannot build it when
551 # cross-compiling GIO because it requires running a binary...
554 test_programs += resources
555 resources_SOURCES = resources.c
556 nodist_resources_SOURCES = test_resources.c test_resources2.c test_resources2.h
557 resources_DEPENDENCIES = test.gresource
559 test_ltlibraries += libresourceplugin.la
560 libresourceplugin_la_SOURCES = resourceplugin.c plugin_resources.c
561 libresourceplugin_la_LDFLAGS = -avoid-version -module -export-dynamic $(no_undefined)
562 libresourceplugin_la_LIBADD = $(LDADD)
564 test_data += test.gresource
566 # libtool contains a bug whereby the created .la file doesn't contain the correct dlname='' in the case that
567 # you're building a library but not installing it. This is apparently because the only considered use for an
568 # uninstalled library is as a convenience library for linking (despite the fact that we give -module). The lack
569 # of dlname='' in the .la trips up libltdl and GModule as well. We can trick libtool into believing that we
570 # will install the module by giving it a bogus -rpath for the uninstalled cases.
572 # See http://lists.gnu.org/archive/html/bug-libtool/2013-05/msg00009.html
573 if !ENABLE_INSTALLED_TESTS
574 libresourceplugin_la_LDFLAGS += -rpath /
577 glib_compile_resources=$(top_builddir)/gio/glib-compile-resources
579 test-generated.txt: test1.txt
580 $(AM_V_GEN) echo "Generated" > $@ && \
583 resources.o: test_resources2.h
584 test_resources.c: test2.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test2.gresource.xml)
585 $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate-source --c-name _g_test1 $<
587 test_resources2.h test_resources2.c: test3.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test3.gresource.xml)
588 $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate --c-name _g_test2 --manual-register $<
590 plugin_resources.c: test4.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test4.gresource.xml)
591 $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate-source --c-name _g_plugin $<
593 test.gresource: test.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=. --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test.gresource.xml)
594 $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=. --sourcedir=$(srcdir) $<
596 EXTRA_DIST += test.gresource.xml test1.txt test2.gresource.xml test2.txt test3.gresource.xml test3.txt test4.gresource.xml
597 CLEANFILES += test-generated.txt test_resources.c test_resources2.[ch] plugin_resources.c test.gresource
598 endif # !CROSS_COMPILING
600 BUILT_SOURCES += giotypefuncs.inc
602 giotypefuncs.inc: Makefile
603 $(AM_V_GEN) echo '#include <gio/gio.h>' > xgen-giosrc.c && \
604 echo "G_GNUC_BEGIN_IGNORE_DEPRECATIONS" > xgen-gio && \
605 ${CPP} $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) xgen-giosrc.c | \
606 $(GREP) -o '\bg_[A-Za-z0-9_]*_get_type\b' | \
607 $(GREP) -v 'g_io_extension_get_type\|g_variant_get_type' | \
608 LC_ALL=C sort | uniq | \
609 $(SED) -e 's/^/*tp++ = /' -e 's/$$/ ();/' >> xgen-gio && \
610 cp xgen-gio $@ # && rm -f xgen-gio xgen-giosrc.c
612 CLEANFILES += xgen-giosrc.c xgen-gio giotypefuncs.inc
614 if ENABLE_INSTALLED_TESTS
617 $(AM_V_at) chmod a+x $(DESTDIR)$(installed_testdir)/x-content/win32-software/autorun.exe