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)
19 # -----------------------------------------------------------------------------
20 # Test programs buildable on all platforms
24 async-close-output-stream \
25 async-splice-output-stream \
26 buffered-input-stream \
27 buffered-output-stream \
35 fileattributematcher \
47 memory-output-stream \
70 uninstalled_test_programs = \
81 uninstalled_test_extra_programs = \
85 gapplication-example-actions \
86 gapplication-example-cmdline \
87 gapplication-example-cmdline2 \
88 gapplication-example-cmdline3 \
89 gapplication-example-dbushooks \
90 gapplication-example-open \
91 gdbus-example-export \
92 gdbus-example-own-name \
94 gdbus-example-proxy-subclass \
95 gdbus-example-server \
96 gdbus-example-subtree \
97 gdbus-example-watch-name \
98 gdbus-example-watch-proxy \
99 gsubprocess-testprog \
107 test_extra_programs = \
108 gdbus-connection-flush-helper \
112 dist_uninstalled_test_data += $(addprefix schema-tests/,$(schema_tests))
114 array-default-not-in-choices.gschema.xml \
115 bad-choice.gschema.xml \
116 bad-key.gschema.xml \
117 bad-key2.gschema.xml \
118 bad-key3.gschema.xml \
119 bad-key4.gschema.xml \
120 bad-type.gschema.xml \
121 bare-alias.gschema.xml \
122 choice-alias.gschema.xml \
123 choice-bad.gschema.xml \
124 choice-badtype.gschema.xml \
125 choice-invalid-alias.gschema.xml \
126 choice-missing-value.gschema.xml \
127 choice-shadowed-alias.gschema.xml \
128 choice-upside-down.gschema.xml \
130 choices-wrong-type.gschema.xml \
131 default-in-aliases.gschema.xml \
132 default-not-in-choices.gschema.xml \
133 default-out-of-range.gschema.xml \
134 description-xmllang.gschema.xml \
135 empty-key.gschema.xml \
136 enum-with-aliases.gschema.xml \
137 enum-with-bad-default.gschema.xml \
138 enum-with-chained-alias.gschema.xml \
139 enum-with-choice.gschema.xml \
140 enum-with-invalid-alias.gschema.xml \
141 enum-with-repeated-alias.gschema.xml \
142 enum-with-repeated-nick.gschema.xml \
143 enum-with-repeated-value.gschema.xml \
144 enum-with-shadow-alias.gschema.xml \
146 extend-and-shadow-indirect.gschema.xml \
147 extend-and-shadow.gschema.xml \
148 extend-missing.gschema.xml \
149 extend-nonlist.gschema.xml \
150 extend-self.gschema.xml \
151 extend-wrong-list-indirect.gschema.xml \
152 extend-wrong-list.gschema.xml \
153 extending.gschema.xml \
154 flags-aliased-default.gschema.xml \
155 flags-bad-default.gschema.xml \
156 flags-more-than-one-bit.gschema.xml \
157 flags-with-enum-attr.gschema.xml \
158 flags-with-enum-tag.gschema.xml \
159 from-docs.gschema.xml \
160 incomplete-list.gschema.xml \
161 inherit-gettext-domain.gschema.xml \
162 invalid-path.gschema.xml \
163 key-in-list-indirect.gschema.xml \
164 key-in-list.gschema.xml \
165 list-of-missing.gschema.xml \
166 missing-quotes.gschema.xml \
167 no-default.gschema.xml \
168 overflow.gschema.xml \
169 override-missing.gschema.xml \
170 override-range-error.gschema.xml \
171 override-then-key.gschema.xml \
172 override-twice.gschema.xml \
173 override-type-error.gschema.xml \
174 override.gschema.xml \
175 range-badtype.gschema.xml \
176 range-default-high.gschema.xml \
177 range-default-low.gschema.xml \
178 range-high-default.gschema.xml \
179 range-low-default.gschema.xml \
180 range-missing-max.gschema.xml \
181 range-missing-min.gschema.xml \
182 range-parse-error.gschema.xml \
183 range-wrong-type.gschema.xml \
185 summary-xmllang.gschema.xml \
186 summary-xmllang-and-attrs.gschema.xml \
187 wrong-category.gschema.xml \
190 test_programs += thumbnail-verification
191 dist_test_data += $(thumbnail_data_files)
192 thumbnail_data_files = $(addprefix thumbnails/,$(thumbnail_tests))
196 header-and-chunk-size.png \
198 huge-chunk-size.png \
207 test_programs += tls-certificate
208 tls_certificate_SOURCES = \
212 dist_test_data += $(cert_data_files)
213 cert_data_files = $(addprefix cert-tests/,$(cert_tests))
226 uninstalled_test_extra_programs += socket-client
227 socket_client_SOURCES = \
229 gtlsconsoleinteraction.c \
230 gtlsconsoleinteraction.h
231 EXTRA_DIST += socket-common.c
233 uninstalled_test_extra_programs += gdbus-daemon
234 nodist_gdbus_daemon_SOURCES = \
235 $(top_builddir)/gio/gdbus-daemon-generated.c
236 gdbus_daemon_SOURCES = \
238 $(top_srcdir)/gio/gdbusdaemon.c
240 # -----------------------------------------------------------------------------
241 # Test programs buildable on UNIX only
246 gdbus-peer-object-manager \
254 test_extra_programs += \
259 # Uninstalled because of the check-for-executable logic in DesktopAppInfo unable to find the installed executable
260 uninstalled_test_programs += \
265 home_desktop_files = \
266 epiphany-weather-for-toronto-island-9c6a4e022b17686306243dada811d550d25eb1fb.desktop \
269 usr_desktop_files = \
272 dconf-editor.desktop \
274 evince-previewer.desktop \
276 file-roller.desktop \
277 gcr-prompter.desktop \
281 gnome-clocks.desktop \
282 gnome-contacts.desktop \
283 gnome-font-viewer.desktop \
284 gnome-music.desktop \
285 gnome-terminal.desktop \
287 kde4/dolphin.desktop \
289 kde4/konqbrowser.desktop \
290 kde4/okular.desktop \
292 nautilus-autorun-software.desktop \
293 nautilus-classic.desktop \
294 nautilus-connect-server.desktop \
300 $(addprefix desktop-files/usr/applications/,$(usr_desktop_files)) \
301 $(addprefix desktop-files/home/applications/,$(home_desktop_files))
304 appinfo-test-actions.desktop \
305 appinfo-test-gnome.desktop \
306 appinfo-test-notgnome.desktop \
307 appinfo-test.desktop \
308 appinfo-test2.desktop \
310 org.gtk.test.dbusappinfo.desktop \
311 x-content/image-dcf/DCIM/Camera/20130831_203925.jpg \
312 x-content/image-dcf/DCIM/Camera/20130831_203928.jpg \
313 x-content/unix-software/autorun.sh \
314 x-content/win32-software/autorun.exe \
317 test_extra_programs += \
322 uninstalled_test_extra_programs += \
323 gdbus-example-unix-fd-client \
326 test_programs += mimeapps
327 clean-local: clean-mimeapps
329 rm -rf xdgdatadir xdgdatahome xdgconfighome
331 uninstalled_test_programs += gsettings gschema-compile
332 gsettings_DEPENDENCIES = test.mo
333 CLEANFILES += test.mo de/LC_MESSAGES/test.mo keyfile/gsettings.store
334 gsettings_CFLAGS = $(AM_CFLAGS) -DSRCDIR=\"$(abs_srcdir)\"
336 $(AM_V_GEN) $(MSGFMT) -o test.mo $(srcdir)/de.po; \
337 $(MKDIR_P) de/LC_MESSAGES; \
338 cp -f test.mo de/LC_MESSAGES
340 dist_uninstalled_test_data += \
341 org.gtk.test.gschema.xml.orig \
342 org.gtk.schemasourcecheck.gschema.xml \
345 # Generated while running the testcase itself...
347 org.gtk.test.gschema.xml \
348 org.gtk.test.enums.xml \
351 schema-source/gschemas.compiled
353 test_programs += gdbus-connection-flush
354 gdbus_connection_flush_SOURCES = \
355 gdbus-connection-flush.c \
361 test_programs += gdbus-non-socket
362 gdbus_non_socket_SOURCES = \
371 # These three are manual-run tests because they need a session bus but don't bring one up themselves
372 uninstalled_test_extra_programs += gdbus-example-objectmanager-client
373 gdbus_example_objectmanager_client_LDADD = gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
375 uninstalled_test_extra_programs += gdbus-example-objectmanager-server
376 gdbus_example_objectmanager_server_LDADD = gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
378 test_extra_programs += gsubprocess-testprog
380 uninstalled_test_extra_programs += gdbus-test-fixture
381 gdbus_test_fixture_LDADD = gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
383 # This is peer to peer so it doesn't need a session bus (so we can run it normally)
384 gdbus_peer_LDADD = gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
386 # This test is currently unreliable
387 test_extra_programs += gdbus-overflow
389 # -----------------------------------------------------------------------------
390 # Test programs that need to bring up a session bus (requires dbus-daemon)
393 gdbus_sessionbus_sources = gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
402 gdbus-close-pending \
404 gdbus-connection-loss \
405 gdbus-connection-slow \
407 gdbus-exit-on-close \
409 gdbus-introspection \
413 gdbus-proxy-threads \
414 gdbus-proxy-well-known-name \
416 gdbus-test-codegen-old \
423 test_programs += gdbus-unix-addresses
426 gdbus_proxy_threads_CFLAGS = $(AM_CFLAGS) $(DBUS1_CFLAGS)
427 actions_SOURCES = $(gdbus_sessionbus_sources) actions.c
428 dbus_appinfo_SOURCES = $(gdbus_sessionbus_sources) dbus-appinfo.c
429 gapplication_SOURCES = $(gdbus_sessionbus_sources) gapplication.c
430 gdbus_auth_SOURCES = $(gdbus_sessionbus_sources) gdbus-auth.c
431 gdbus_bz627724_SOURCES = $(gdbus_sessionbus_sources) gdbus-bz627724.c
432 gdbus_close_pending_SOURCES = $(gdbus_sessionbus_sources) gdbus-close-pending.c
433 gdbus_connection_SOURCES = $(gdbus_sessionbus_sources) gdbus-connection.c
434 gdbus_connection_loss_SOURCES = $(gdbus_sessionbus_sources) gdbus-connection-loss.c
435 gdbus_connection_slow_SOURCES = $(gdbus_sessionbus_sources) gdbus-connection-slow.c
436 gdbus_error_SOURCES = $(gdbus_sessionbus_sources) gdbus-error.c
437 gdbus_exit_on_close_SOURCES = $(gdbus_sessionbus_sources) gdbus-exit-on-close.c
438 gdbus_export_SOURCES = $(gdbus_sessionbus_sources) gdbus-export.c
439 gdbus_introspection_SOURCES = $(gdbus_sessionbus_sources) gdbus-introspection.c
440 gdbus_names_SOURCES = $(gdbus_sessionbus_sources) gdbus-names.c
441 gdbus_proxy_SOURCES = $(gdbus_sessionbus_sources) gdbus-proxy.c
442 gdbus_proxy_threads_SOURCES = $(gdbus_sessionbus_sources) gdbus-proxy-threads.c
443 gdbus_proxy_well_known_name_SOURCES = $(gdbus_sessionbus_sources) gdbus-proxy-well-known-name.c
444 gdbus_test_codegen_SOURCES = $(gdbus_sessionbus_sources) gdbus-test-codegen.c
445 nodist_gdbus_test_codegen_SOURCES = gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
446 gdbus_test_codegen_old_SOURCES = $(gdbus_sessionbus_sources) gdbus-test-codegen.c
447 nodist_gdbus_test_codegen_old_SOURCES = gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
448 gdbus_test_codegen_old_CPPFLAGS = $(AM_CPPFLAGS) -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36
449 gdbus_threading_SOURCES = $(gdbus_sessionbus_sources) gdbus-threading.c
450 gmenumodel_SOURCES = $(gdbus_sessionbus_sources) gmenumodel.c
451 gnotification_SOURCES = $(gdbus_sessionbus_sources) gnotification.c gnotification-server.h gnotification-server.c
453 BUILT_SOURCES += gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
454 gdbus-test-codegen.o: gdbus-test-codegen-generated.h
455 gdbus-test-codegen-generated.h: test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
456 $(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
457 UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
458 $(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
459 --interface-prefix org.project. \
460 --generate-c-code gdbus-test-codegen-generated \
461 --c-generate-object-manager \
462 --c-namespace Foo_iGen \
463 --generate-docbook gdbus-test-codegen-generated-doc \
464 --annotate "org.project.Bar" Key1 Value1 \
465 --annotate "org.project.Bar" org.gtk.GDBus.Internal Value2 \
466 --annotate "org.project.Bar.HelloWorld()" Key3 Value3 \
467 --annotate "org.project.Bar::TestSignal" Key4 Value4 \
468 --annotate "org.project.Bar:ay" Key5 Value5 \
469 --annotate "org.project.Bar.TestPrimitiveTypes()[val_int32]" Key6 Value6 \
470 --annotate "org.project.Bar.TestPrimitiveTypes()[ret_uint32]" Key7 Value7 \
471 --annotate "org.project.Bar::TestSignal[array_of_strings]" Key8 Value8 \
472 $(srcdir)/test-codegen.xml \
474 gdbus-test-codegen-generated.c: gdbus-test-codegen-generated.h
475 @: # Generated as side-effect of .h
477 EXTRA_DIST += test-codegen.xml
478 CLEANFILES += gdbus-test-codegen-generated.[ch] gdbus-test-codegen-generated-doc-*.xml
480 endif # HAVE_DBUS_DAEMON
482 tls_interaction_SOURCES = tls-interaction.c gtesttlsbackend.c gtesttlsbackend.h
484 # -----------------------------------------------------------------------------
487 test_programs += win32-streams
491 no_undefined = -no-undefined
495 test_programs += gdbus-serialization
496 gdbus_serialization_CFLAGS = $(AM_CFLAGS) $(DBUS1_CFLAGS)
497 gdbus_serialization_LDADD = $(LDADD) $(DBUS1_LIBS)
498 gdbus_serialization_SOURCES = \
499 gdbus-serialization.c \
510 # -----------------------------------------------------------------------------
511 # The resources test is a bit more complicated, and we cannot build it when
512 # cross-compiling GIO because it requires running a binary...
515 test_programs += resources
516 resources_SOURCES = resources.c
517 nodist_resources_SOURCES = test_resources.c test_resources2.c test_resources2.h
518 resources_DEPENDENCIES = test.gresource
520 test_ltlibraries += libresourceplugin.la
521 libresourceplugin_la_SOURCES = resourceplugin.c plugin_resources.c
522 libresourceplugin_la_LDFLAGS = -avoid-version -module -export-dynamic $(no_undefined)
523 libresourceplugin_la_LIBADD = $(LDADD)
525 test_data += test.gresource
527 # libtool contains a bug whereby the created .la file doesn't contain the correct dlname='' in the case that
528 # you're building a library but not installing it. This is apparently because the only considered use for an
529 # uninstalled library is as a convenience library for linking (despite the fact that we give -module). The lack
530 # of dlname='' in the .la trips up libltdl and GModule as well. We can trick libtool into believing that we
531 # will install the module by giving it a bogus -rpath for the uninstalled cases.
533 # See http://lists.gnu.org/archive/html/bug-libtool/2013-05/msg00009.html
534 if !ENABLE_INSTALLED_TESTS
535 libresourceplugin_la_LDFLAGS += -rpath /
538 glib_compile_resources=$(top_builddir)/gio/glib-compile-resources
540 test-generated.txt: test1.txt
541 $(AM_V_GEN) echo "Generated" > $@ && \
544 resources.o: test_resources2.h
545 test_resources.c: test2.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test2.gresource.xml)
546 $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate-source --c-name _g_test1 $<
548 test_resources2.h test_resources2.c: test3.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test3.gresource.xml)
549 $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate --c-name _g_test2 --manual-register $<
551 plugin_resources.c: test4.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test4.gresource.xml)
552 $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate-source --c-name _g_plugin $<
554 test.gresource: test.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=. --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test.gresource.xml)
555 $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=. --sourcedir=$(srcdir) $<
557 EXTRA_DIST += test.gresource.xml test1.txt test2.gresource.xml test2.txt test3.gresource.xml test3.txt test4.gresource.xml
558 CLEANFILES += test-generated.txt test_resources.c test_resources2.[ch] plugin_resources.c test.gresource
559 endif # !CROSS_COMPILING
561 BUILT_SOURCES += giotypefuncs.c
563 giotypefuncs.c: Makefile
564 $(AM_V_GEN) echo '#include <gio/gio.h>' > xgen-giosrc.c && \
565 echo "G_GNUC_BEGIN_IGNORE_DEPRECATIONS" > xgen-gio && \
566 ${CPP} $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) xgen-giosrc.c | \
567 $(GREP) -o '\bg_[A-Za-z0-9_]*_get_type\b' | \
568 $(GREP) -v 'g_io_extension_get_type\|g_variant_get_type' | \
569 LC_ALL=C sort | uniq | \
570 $(SED) -e 's/^/*tp++ = /' -e 's/$$/ ();/' >> xgen-gio && \
571 cp xgen-gio $@ # && rm -f xgen-gio xgen-giosrc.c
573 CLEANFILES += xgen-giosrc.c xgen-gio giotypefuncs.c
575 if ENABLE_INSTALLED_TESTS
578 $(AM_V_at) chmod a+x $(DESTDIR)$(installed_testdir)/x-content/win32-software/autorun.exe