[kdbus] KDBUS_ITEM_PAYLOAD_OFF items are (once again) relative to msg header
[platform/upstream/glib.git] / gio / tests / Makefile.am
index f95196b..5127de7 100644 (file)
+include $(top_srcdir)/glib-tap.mk
 
-NULL =
-BUILT_SOURCES =
+dist_uninstalled_test_data =
+test_ltlibraries =
 
-include $(top_srcdir)/Makefile.decl
+SUBDIRS = gdbus-object-manager-example services modules
 
-SUBDIRS = gdbus-object-manager-example
-
-INCLUDES =                     \
-       -g                      \
-       $(gio_INCLUDES)         \
-       $(GLIB_DEBUG_FLAGS)     \
-       -I$(top_builddir)/gio   \
-       -I$(top_srcdir)/gio     \
-       $(DBUS1_CFLAGS)         \
-       -DSRCDIR=\""$(srcdir)"\"
-
-noinst_PROGRAMS = $(TEST_PROGS) $(SAMPLE_PROGS)
-noinst_DATA = $(MISC_STUFF)
-
-progs_ldadd     =                                      \
-       $(top_builddir)/glib/libglib-2.0.la             \
-       $(top_builddir)/gthread/libgthread-2.0.la       \
+LDADD = \
+       $(top_builddir)/gio/libgio-2.0.la               \
        $(top_builddir)/gobject/libgobject-2.0.la       \
        $(top_builddir)/gmodule/libgmodule-2.0.la       \
-       $(top_builddir)/gio/libgio-2.0.la
-
-TEST_PROGS +=                  \
-       io-stream               \
-       actions                 \
-       memory-input-stream     \
-       memory-output-stream    \
-       readwrite               \
-       g-file                  \
-       g-file-info             \
-       converter-stream        \
-       data-input-stream       \
-       data-output-stream      \
-       g-icon                  \
-       buffered-input-stream   \
-       buffered-output-stream  \
-       sleepy-stream           \
-       filter-streams          \
-       volumemonitor           \
-       simple-async-result     \
-       srvtarget               \
-       contexts                \
-       gsettings               \
-       gschema-compile         \
-       async-close-output-stream \
-       gdbus-addresses         \
-       network-address         \
-       gdbus-message           \
-       socket                  \
-       pollable                \
-       tls-certificate         \
-       tls-interaction         \
-       cancellable             \
-       vfs                     \
-       network-monitor         \
-       fileattributematcher    \
-       gmenumodel              \
-       resources               \
+       $(top_builddir)/glib/libglib-2.0.la             \
        $(NULL)
 
-if OS_UNIX
-TEST_PROGS +=                  \
-       gdbus-close-pending     \
-       gdbus-connection        \
-       gdbus-connection-flush  \
-       gdbus-connection-loss   \
-       gdbus-connection-slow   \
-       gdbus-names             \
-       gdbus-proxy             \
-       gdbus-proxy-threads     \
-       gdbus-proxy-well-known-name \
-       gdbus-introspection     \
-       gdbus-threading         \
-       gdbus-export            \
-       gdbus-error             \
-       gdbus-peer              \
-       gdbus-exit-on-close     \
-       gdbus-non-socket        \
-       gdbus-bz627724          \
-       appinfo                 \
-       contenttype             \
-       mimeapps                \
-       file                    \
-       $(NULL)
-endif
+AM_CPPFLAGS = $(gio_INCLUDES) $(GLIB_DEBUG_FLAGS) -I$(top_builddir)/gio -I$(top_srcdir)/gio
+DEFS = -DG_LOG_DOMAIN=\"GLib-GIO\" -DTEST_SERVICES=\""$(abs_top_builddir)/gio/tests/services"\"
+AM_CFLAGS = $(GLIB_WARN_CFLAGS)
 
-SAMPLE_PROGS =                                 \
-       resolver                        \
-       socket-server                   \
-       socket-client                   \
-       echo-server                     \
-       httpd                           \
-       send-data                       \
-       filter-cat                      \
-       gdbus-example-export            \
-       gdbus-example-own-name          \
-       gdbus-example-watch-name        \
-       gdbus-example-watch-proxy       \
-       gdbus-example-server            \
-       gdbus-example-subtree           \
-       gdbus-example-peer              \
-       gdbus-example-proxy-subclass    \
-       gdbus-connection-flush-helper   \
-       appinfo-test                    \
-       proxy                           \
-       gapplication-example-open       \
-       gapplication-example-cmdline    \
-       gapplication-example-cmdline2   \
-       gapplication-example-cmdline3   \
-       gapplication-example-actions    \
+# -----------------------------------------------------------------------------
+#  Test programs buildable on all platforms
+
+test_programs = \
+       appmonitor                              \
+       async-close-output-stream               \
+       async-splice-output-stream              \
+       buffered-input-stream                   \
+       buffered-output-stream                  \
+       cancellable                             \
+       contexts                                \
+       converter-stream                        \
+       credentials                             \
+       data-input-stream                       \
+       data-output-stream                      \
+       defaultvalue                            \
+       fileattributematcher                    \
+       filter-streams                          \
+       giomodule                               \
+       gsubprocess                             \
+       g-file                                  \
+       g-file-info                             \
+       g-icon                                  \
+       gdbus-addresses                         \
+       gdbus-message                           \
+       inet-address                            \
+       io-stream                               \
+       memory-input-stream                     \
+       memory-output-stream                    \
+       monitor                                 \
+       network-address                         \
+       network-monitor                         \
+       permission                              \
+       pollable                                \
+       proxy-test                              \
+       readwrite                               \
+       simple-async-result                     \
+       simple-proxy                            \
+       sleepy-stream                           \
+       socket                                  \
+       socket-listener                         \
+       srvtarget                               \
+       task                                    \
+       tls-interaction                         \
+       vfs                                     \
+       volumemonitor                           \
        $(NULL)
 
-
-if OS_UNIX
-TEST_PROGS +=                  \
-       live-g-file             \
-       desktop-app-info        \
-       unix-fd                 \
-       unix-streams            \
-       gapplication            \
-       basic-application       \
-       gdbus-test-codegen      \
-       $(NULL)
-SAMPLE_PROGS +=                                        \
-       gdbus-example-unix-fd-client            \
-       gdbus-example-objectmanager-server      \
-       gdbus-example-objectmanager-client      \
+uninstalled_test_programs = \
        $(NULL)
-endif
-
-if OS_WIN32
-TEST_PROGS += win32-streams
-endif
-
-io_stream_SOURCES = io-stream.c
-io_stream_LDADD   = $(progs_ldadd)
-
-actions_LDADD    = $(progs_ldadd)
 
-memory_input_stream_SOURCES      = memory-input-stream.c
-memory_input_stream_LDADD        = $(progs_ldadd)
-
-memory_output_stream_SOURCES     = memory-output-stream.c
-memory_output_stream_LDADD       = $(progs_ldadd)
-
-g_file_SOURCES   = g-file.c
-g_file_LDADD     = $(progs_ldadd)
-
-readwrite_SOURCES        = readwrite.c
-readwrite_LDADD          = $(progs_ldadd)
-
-g_file_info_SOURCES    = g-file-info.c
-g_file_info_LDADD      = $(progs_ldadd)
-
-converter_stream_SOURCES       = converter-stream.c
-converter_stream_LDADD         = $(progs_ldadd)
-
-data_input_stream_SOURCES      = data-input-stream.c
-data_input_stream_LDADD                = $(progs_ldadd)
-
-data_output_stream_SOURCES     = data-output-stream.c
-data_output_stream_LDADD       = $(progs_ldadd)
-
-async_close_output_stream_SOURCES      = async-close-output-stream.c
-async_close_output_stream_LDADD                = $(progs_ldadd)
-
-filter_cat_SOURCES     = filter-cat.c
-filter_cat_LDADD       = $(progs_ldadd)
-
-g_icon_SOURCES = g-icon.c
-g_icon_LDADD   = $(progs_ldadd)
-
-buffered_input_stream_SOURCES  = buffered-input-stream.c
-buffered_input_stream_LDADD    = $(progs_ldadd)
-
-buffered_output_stream_SOURCES = buffered-output-stream.c
-buffered_output_stream_LDADD   = $(progs_ldadd)
+dist_test_data = \
+       contexts.c                              \
+       g-icon.c                                \
+       $(NULL)
 
-live_g_file_SOURCES      = live-g-file.c
-live_g_file_LDADD        = $(progs_ldadd)
+test_data = \
+       test.gresource                          \
+       $(NULL)
 
-desktop_app_info_SOURCES  = desktop-app-info.c
-desktop_app_info_LDADD   = $(progs_ldadd)
+uninstalled_test_extra_programs = \
+       gio-du                                  \
+       echo-server                             \
+       filter-cat                              \
+       gapplication-example-actions            \
+       gapplication-example-cmdline            \
+       gapplication-example-cmdline2           \
+       gapplication-example-cmdline3           \
+       gapplication-example-dbushooks          \
+       gapplication-example-open               \
+       gdbus-example-export                    \
+       gdbus-example-own-name                  \
+       gdbus-example-peer                      \
+       gdbus-example-proxy-subclass            \
+       gdbus-example-server                    \
+       gdbus-example-subtree                   \
+       gdbus-example-watch-name                \
+       gdbus-example-watch-proxy               \
+       gsubprocess-testprog                    \
+       httpd                                   \
+       proxy                                   \
+       resolver                                \
+       send-data                               \
+       socket-server                           \
+       $(NULL)
 
-unix_streams_SOURCES     = unix-streams.c
-unix_streams_LDADD       = $(progs_ldadd) \
-       $(top_builddir)/gthread/libgthread-2.0.la
+test_extra_programs = \
+       gdbus-connection-flush-helper           \
+       gdbus-testserver                        \
+       $(NULL)
 
-win32_streams_SOURCES    = win32-streams.c
-win32_streams_LDADD      = $(progs_ldadd) \
-       $(top_builddir)/gthread/libgthread-2.0.la
+dist_uninstalled_test_data += $(addprefix schema-tests/,$(schema_tests))
+schema_tests = \
+       array-default-not-in-choices.gschema.xml        \
+       bad-choice.gschema.xml                          \
+       bad-key.gschema.xml                             \
+       bad-key2.gschema.xml                            \
+       bad-key3.gschema.xml                            \
+       bad-key4.gschema.xml                            \
+       bad-type.gschema.xml                            \
+       bare-alias.gschema.xml                          \
+       choice-alias.gschema.xml                        \
+       choice-bad.gschema.xml                          \
+       choice-badtype.gschema.xml                      \
+       choice-invalid-alias.gschema.xml                \
+       choice-missing-value.gschema.xml                \
+       choice-shadowed-alias.gschema.xml               \
+       choice-upside-down.gschema.xml                  \
+       choice.gschema.xml                              \
+       choices-wrong-type.gschema.xml                  \
+       default-in-aliases.gschema.xml                  \
+       default-not-in-choices.gschema.xml              \
+       default-out-of-range.gschema.xml                \
+       empty-key.gschema.xml                           \
+       enum-with-aliases.gschema.xml                   \
+       enum-with-bad-default.gschema.xml               \
+       enum-with-chained-alias.gschema.xml             \
+       enum-with-choice.gschema.xml                    \
+       enum-with-invalid-alias.gschema.xml             \
+       enum-with-repeated-alias.gschema.xml            \
+       enum-with-repeated-nick.gschema.xml             \
+       enum-with-repeated-value.gschema.xml            \
+       enum-with-shadow-alias.gschema.xml              \
+       enum.gschema.xml                                \
+       extend-and-shadow-indirect.gschema.xml          \
+       extend-and-shadow.gschema.xml                   \
+       extend-missing.gschema.xml                      \
+       extend-nonlist.gschema.xml                      \
+       extend-self.gschema.xml                         \
+       extend-wrong-list-indirect.gschema.xml          \
+       extend-wrong-list.gschema.xml                   \
+       extending.gschema.xml                           \
+       flags-aliased-default.gschema.xml               \
+       flags-bad-default.gschema.xml                   \
+       flags-more-than-one-bit.gschema.xml             \
+       flags-with-enum-attr.gschema.xml                \
+       flags-with-enum-tag.gschema.xml                 \
+       from-docs.gschema.xml                           \
+       incomplete-list.gschema.xml                     \
+       inherit-gettext-domain.gschema.xml              \
+       invalid-path.gschema.xml                        \
+       key-in-list-indirect.gschema.xml                \
+       key-in-list.gschema.xml                         \
+       list-of-missing.gschema.xml                     \
+       missing-quotes.gschema.xml                      \
+       no-default.gschema.xml                          \
+       overflow.gschema.xml                            \
+       override-missing.gschema.xml                    \
+       override-range-error.gschema.xml                \
+       override-then-key.gschema.xml                   \
+       override-twice.gschema.xml                      \
+       override-type-error.gschema.xml                 \
+       override.gschema.xml                            \
+       range-badtype.gschema.xml                       \
+       range-default-high.gschema.xml                  \
+       range-default-low.gschema.xml                   \
+       range-high-default.gschema.xml                  \
+       range-low-default.gschema.xml                   \
+       range-missing-max.gschema.xml                   \
+       range-missing-min.gschema.xml                   \
+       range-parse-error.gschema.xml                   \
+       range-wrong-type.gschema.xml                    \
+       range.gschema.xml                               \
+       wrong-category.gschema.xml                      \
+       $(NULL)
 
-unix_fd_SOURCES          = unix-fd.c
-unix_fd_LDADD    = $(progs_ldadd)
+test_programs += thumbnail-verification
+dist_test_data += $(thumbnail_data_files)
+thumbnail_data_files = $(addprefix thumbnails/,$(thumbnail_tests))
+thumbnail_tests = \
+       bad-header.png \
+       empty-key.png \
+       header-and-chunk-size.png \
+       header-only.png \
+       huge-chunk-size.png \
+       mtime-zero.png \
+       no-text-data.png \
+       overlong-value.png \
+       uri-mismatch.png \
+       valid.png \
+       valid-no-size.png \
+       $(NULL)
 
-simple_async_result_SOURCES    = simple-async-result.c
-simple_async_result_LDADD      = $(progs_ldadd)
+test_programs += tls-certificate
+tls_certificate_SOURCES = \
+       tls-certificate.c                       \
+       gtesttlsbackend.c                       \
+       gtesttlsbackend.h
+dist_test_data += $(cert_data_files)
+cert_data_files = $(addprefix cert-tests/,$(cert_tests))
+cert_tests = \
+       cert1.pem       \
+       cert2.pem       \
+       cert3.pem       \
+       cert-key.pem    \
+       cert-list.pem   \
+       key8.pem        \
+       key-cert.pem    \
+       key.pem         \
+       nothing.pem     \
+       $(NULL)
 
-sleepy_stream_SOURCES          = sleepy-stream.c
-sleepy_stream_LDADD            = $(progs_ldadd)
+uninstalled_test_extra_programs += socket-client
+socket_client_SOURCES = \
+       socket-client.c                         \
+       gtlsconsoleinteraction.c                \
+       gtlsconsoleinteraction.h
+EXTRA_DIST += socket-common.c
 
-filter_streams_SOURCES         = filter-streams.c
-filter_streams_LDADD           = $(progs_ldadd)
+uninstalled_test_extra_programs += gdbus-daemon
+nodist_gdbus_daemon_SOURCES = \
+       $(top_builddir)/gio/gdbus-daemon-generated.c
+gdbus_daemon_SOURCES = \
+       gdbus-daemon.c                          \
+       $(top_srcdir)/gio/gdbusdaemon.c
 
-volumemonitor_SOURCES          = volumemonitor.c
-volumemonitor_LDADD            = $(progs_ldadd)
+# -----------------------------------------------------------------------------
+#  Test programs buildable on UNIX only
 
-resolver_SOURCES         = resolver.c
-resolver_LDADD           = $(progs_ldadd) \
-       $(top_builddir)/gthread/libgthread-2.0.la
+if OS_UNIX
+test_programs += \
+       contenttype                             \
+       file                                    \
+       gdbus-peer-object-manager               \
+       live-g-file                             \
+       socket-address                          \
+       stream-rw_all                           \
+       unix-fd                                 \
+       unix-streams                            \
+       $(NULL)
 
-socket_server_SOURCES    = socket-server.c
-socket_server_LDADD      = $(progs_ldadd) \
-       $(top_builddir)/gthread/libgthread-2.0.la
+test_extra_programs += \
+       basic-application                       \
+       $(NULL)
 
-socket_client_SOURCES    = socket-client.c \
-                            gtlsconsoleinteraction.c \
-                            gtlsconsoleinteraction.h
-socket_client_LDADD      = $(progs_ldadd) \
-       $(top_builddir)/gthread/libgthread-2.0.la
+# Uninstalled because of the check-for-executable logic in DesktopAppInfo unable to find the installed executable
+uninstalled_test_programs += \
+       appinfo                                 \
+       desktop-app-info                        \
+       $(NULL)
 
-echo_server_SOURCES      = echo-server.c
-echo_server_LDADD        = $(progs_ldadd) \
-       $(top_builddir)/gthread/libgthread-2.0.la
+home_desktop_files = \
+       epiphany-weather-for-toronto-island-9c6a4e022b17686306243dada811d550d25eb1fb.desktop    \
+       eog.desktop
+
+usr_desktop_files = \
+       baobab.desktop                          \
+       cheese.desktop                          \
+       dconf-editor.desktop                    \
+       eog.desktop                             \
+       evince-previewer.desktop                \
+       evince.desktop                          \
+       file-roller.desktop                     \
+       gcr-prompter.desktop                    \
+       gcr-viewer.desktop                      \
+       gedit.desktop                           \
+       glade.desktop                           \
+       gnome-clocks.desktop                    \
+       gnome-contacts.desktop                  \
+       gnome-font-viewer.desktop               \
+       gnome-music.desktop                     \
+       gnome-terminal.desktop                  \
+       gucharmap.desktop                       \
+       kde4/dolphin.desktop                    \
+       kde4/kate.desktop                       \
+       kde4/konqbrowser.desktop                \
+       kde4/okular.desktop                     \
+       mimeinfo.cache                          \
+       nautilus-autorun-software.desktop       \
+       nautilus-classic.desktop                \
+       nautilus-connect-server.desktop         \
+       nautilus.desktop                        \
+       totem.desktop                           \
+       yelp.desktop
+
+dist_test_data += \
+       $(addprefix desktop-files/usr/applications/,$(usr_desktop_files))       \
+       $(addprefix desktop-files/home/applications/,$(home_desktop_files))
+
+dist_test_data += \
+       appinfo-test-actions.desktop            \
+       appinfo-test-gnome.desktop              \
+       appinfo-test-notgnome.desktop           \
+       appinfo-test.desktop                    \
+       appinfo-test2.desktop                   \
+       file.c                                  \
+       org.gtk.test.dbusappinfo.desktop        \
+       x-content/image-dcf/DCIM/Camera/20130831_203925.jpg \
+       x-content/image-dcf/DCIM/Camera/20130831_203928.jpg \
+       x-content/unix-software/autorun.sh      \
+       x-content/win32-software/autorun.exe    \
+       $(NULL)
 
-httpd_SOURCES            = httpd.c
-httpd_LDADD              = $(progs_ldadd) \
-       $(top_builddir)/gthread/libgthread-2.0.la
+test_extra_programs += \
+       appinfo-test                            \
+       apps                                    \
+       $(NULL)
 
-send_data_SOURCES        = send-data.c
-send_data_LDADD                  = $(progs_ldadd) \
-       $(top_builddir)/gthread/libgthread-2.0.la
+uninstalled_test_extra_programs += \
+       gdbus-example-unix-fd-client            \
+       $(NULL)
 
-srvtarget_SOURCES        = srvtarget.c
-srvtarget_LDADD                  = $(progs_ldadd)
+test_programs += mimeapps
+clean-local: clean-mimeapps
+clean-mimeapps:
+       rm -rf xdgdatadir xdgdatahome xdgconfighome
 
-network_address_SOURCE   = network-address.c
-network_address_LDADD    = $(progs_ldadd)
+uninstalled_test_programs += gsettings gschema-compile
+gsettings_DEPENDENCIES = test.mo
+CLEANFILES += test.mo de/LC_MESSAGES/test.mo keyfile/gsettings.store
+gsettings_CFLAGS = $(AM_CFLAGS) -DSRCDIR=\"$(abs_srcdir)\"
+test.mo: de.po
+       $(AM_V_GEN) $(MSGFMT) -o test.mo $(srcdir)/de.po; \
+       $(MKDIR_P) de/LC_MESSAGES; \
+       cp -f test.mo de/LC_MESSAGES
+EXTRA_DIST += de.po
+dist_uninstalled_test_data += \
+       org.gtk.test.gschema.xml.orig           \
+       org.gtk.schemasourcecheck.gschema.xml   \
+       testenum.h                              \
+       enums.xml.template
+# Generated while running the testcase itself...
+CLEANFILES += \
+       org.gtk.test.gschema.xml        \
+       org.gtk.test.enums.xml          \
+       gsettings.store                 \
+       gschemas.compiled               \
+       schema-source/gschemas.compiled
 
-socket_SOURCE            = socket.c
-socket_LDADD             = $(progs_ldadd)
+test_programs += gdbus-connection-flush
+gdbus_connection_flush_SOURCES = \
+       gdbus-connection-flush.c                \
+       test-io-stream.c                        \
+       test-io-stream.h                        \
+       test-pipe-unix.c                        \
+       test-pipe-unix.h
 
-pollable_SOURCE                  = pollable.c
-pollable_LDADD           = $(progs_ldadd)
+test_programs += gdbus-non-socket
+gdbus_non_socket_SOURCES = \
+       gdbus-non-socket.c                      \
+       gdbus-tests.c                           \
+       gdbus-tests.h                           \
+       test-io-stream.c                        \
+       test-io-stream.h                        \
+       test-pipe-unix.c                        \
+       test-pipe-unix.h
 
-contexts_SOURCES         = contexts.c
-contexts_LDADD           = $(progs_ldadd) \
-       $(top_builddir)/gthread/libgthread-2.0.la
+# These three are manual-run tests because they need a session bus but don't bring one up themselves
+uninstalled_test_extra_programs += gdbus-example-objectmanager-client
+gdbus_example_objectmanager_client_LDADD = gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
 
-gsettings_SOURCES        = gsettings.c
-gsettings_LDADD                  = $(progs_ldadd)
+test_extra_programs += gsubprocess-testprog
 
-gschema_compile_SOURCES          = gschema-compile.c
-gschema_compile_LDADD    = $(progs_ldadd)
+uninstalled_test_extra_programs += gdbus-test-fixture
+gdbus_test_fixture_LDADD = gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
 
-if HAVE_DBUS1
-TEST_PROGS += gdbus-serialization
-gdbus_serialization_SOURCES = gdbus-serialization.c gdbus-tests.h gdbus-tests.c
-gdbus_serialization_CFLAGS = $(DBUS1_CFLAGS)
-gdbus_serialization_LDADD = $(progs_ldadd) $(DBUS1_LIBS)
-endif
+# This is peer to peer so it doesn't need a session bus (so we can run it normally)
+test_programs += gdbus-peer
+gdbus_peer_LDADD = gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
 
-gdbus_addresses_SOURCES = gdbus-addresses.c
-gdbus_addresses_LDADD = $(progs_ldadd)
+# This test is currently unreliable
+test_extra_programs += gdbus-overflow
 
-gdbus_bz627724_SOURCES = gdbus-bz627724.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
-gdbus_bz627724_LDADD = $(progs_ldadd)
+# -----------------------------------------------------------------------------
+#  Test programs that need to bring up a session bus (requires dbus-daemon)
+
+if HAVE_DBUS_DAEMON
+gdbus_sessionbus_sources = gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
+
+test_programs += \
+       actions                                 \
+       dbus-appinfo                            \
+       gapplication                            \
+       gdbus-auth                              \
+       gdbus-bz627724                          \
+       gdbus-close-pending                     \
+       gdbus-connection                        \
+       gdbus-connection-loss                   \
+       gdbus-connection-slow                   \
+       gdbus-error                             \
+       gdbus-exit-on-close                     \
+       gdbus-export                            \
+       gdbus-introspection                     \
+       gdbus-names                             \
+       gdbus-proxy                             \
+       gdbus-proxy-threads                     \
+       gdbus-proxy-well-known-name             \
+       gdbus-test-codegen                      \
+       gdbus-test-codegen-old                  \
+       gdbus-threading                         \
+       gmenumodel                              \
+       gnotification                           \
+       $(NULL)
 
-gdbus_close_pending_SOURCES = gdbus-close-pending.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
-gdbus_close_pending_LDADD = $(progs_ldadd)
+gdbus_proxy_threads_CFLAGS = $(AM_CFLAGS) $(DBUS1_CFLAGS)
+actions_SOURCES                          = $(gdbus_sessionbus_sources) actions.c
+dbus_appinfo_SOURCES                     = $(gdbus_sessionbus_sources) dbus-appinfo.c
+gapplication_SOURCES                     = $(gdbus_sessionbus_sources) gapplication.c
+gdbus_auth_SOURCES                       = $(gdbus_sessionbus_sources) gdbus-auth.c
+gdbus_bz627724_SOURCES                   = $(gdbus_sessionbus_sources) gdbus-bz627724.c
+gdbus_close_pending_SOURCES              = $(gdbus_sessionbus_sources) gdbus-close-pending.c
+gdbus_connection_SOURCES                 = $(gdbus_sessionbus_sources) gdbus-connection.c
+gdbus_connection_loss_SOURCES            = $(gdbus_sessionbus_sources) gdbus-connection-loss.c
+gdbus_connection_slow_SOURCES            = $(gdbus_sessionbus_sources) gdbus-connection-slow.c
+gdbus_error_SOURCES                      = $(gdbus_sessionbus_sources) gdbus-error.c
+gdbus_exit_on_close_SOURCES              = $(gdbus_sessionbus_sources) gdbus-exit-on-close.c
+gdbus_export_SOURCES                     = $(gdbus_sessionbus_sources) gdbus-export.c
+gdbus_introspection_SOURCES              = $(gdbus_sessionbus_sources) gdbus-introspection.c
+gdbus_names_SOURCES                      = $(gdbus_sessionbus_sources) gdbus-names.c
+gdbus_proxy_SOURCES                      = $(gdbus_sessionbus_sources) gdbus-proxy.c
+gdbus_proxy_threads_SOURCES              = $(gdbus_sessionbus_sources) gdbus-proxy-threads.c
+gdbus_proxy_well_known_name_SOURCES      = $(gdbus_sessionbus_sources) gdbus-proxy-well-known-name.c
+gdbus_test_codegen_SOURCES               = $(gdbus_sessionbus_sources) gdbus-test-codegen.c
+nodist_gdbus_test_codegen_SOURCES        = gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
+gdbus_test_codegen_old_SOURCES           = $(gdbus_sessionbus_sources) gdbus-test-codegen.c
+nodist_gdbus_test_codegen_old_SOURCES    = gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
+gdbus_test_codegen_old_CPPFLAGS          = $(AM_CPPFLAGS) -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36
+gdbus_threading_SOURCES                  = $(gdbus_sessionbus_sources) gdbus-threading.c
+gmenumodel_SOURCES                       = $(gdbus_sessionbus_sources) gmenumodel.c
+gnotification_SOURCES                    = $(gdbus_sessionbus_sources) gnotification.c gnotification-server.h gnotification-server.c
 
-if OS_UNIX
-gdbus-test-codegen-generated.h gdbus-test-codegen-generated.c : test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
+BUILT_SOURCES += gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
+gdbus-test-codegen.o: gdbus-test-codegen-generated.h
+gdbus-test-codegen-generated.h: test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
        $(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
                UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
                $(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
@@ -294,322 +458,98 @@ gdbus-test-codegen-generated.h gdbus-test-codegen-generated.c : test-codegen.xml
                --annotate "org.project.Bar::TestSignal[array_of_strings]" Key8 Value8 \
                $(srcdir)/test-codegen.xml \
                $(NULL)
+gdbus-test-codegen-generated.c: gdbus-test-codegen-generated.h
+       @: # Generated as side-effect of .h
 
-BUILT_SOURCES += gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
-
-gdbus_test_codegen_SOURCES  = gdbus-test-codegen.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
-gdbus_test_codegen_SOURCES += gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
-gdbus_test_codegen_LDADD = $(progs_ldadd)
+EXTRA_DIST += test-codegen.xml
+CLEANFILES += gdbus-test-codegen-generated.[ch] gdbus-test-codegen-generated-doc-*.xml
 endif # OS_UNIX
+endif # HAVE_DBUS_DAEMON
 
-gdbus_connection_SOURCES = gdbus-connection.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
-gdbus_connection_LDADD = $(progs_ldadd)
-
-gdbus_connection_flush_SOURCES = \
-       gdbus-connection-flush.c \
-       test-io-stream.c \
-       test-io-stream.h \
-       test-pipe-unix.c \
-       test-pipe-unix.h \
-       $(NULL)
-gdbus_connection_flush_LDADD = $(progs_ldadd)
-
-gdbus_connection_loss_SOURCES = gdbus-connection-loss.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
-gdbus_connection_loss_LDADD = $(progs_ldadd)
-
-gdbus_connection_slow_SOURCES = gdbus-connection-slow.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
-gdbus_connection_slow_LDADD = $(progs_ldadd)
-
-gdbus_message_SOURCES = gdbus-message.c
-gdbus_message_LDADD = $(progs_ldadd)
-
-gdbus_names_SOURCES = gdbus-names.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
-gdbus_names_LDADD = $(progs_ldadd)
-
-gdbus_proxy_SOURCES = gdbus-proxy.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
-gdbus_proxy_LDADD = $(progs_ldadd)
-
-gdbus_proxy_threads_SOURCES = gdbus-proxy-threads.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
-gdbus_proxy_threads_LDADD = $(progs_ldadd)
-
-gdbus_proxy_well_known_name_SOURCES = gdbus-proxy-well-known-name.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
-gdbus_proxy_well_known_name_LDADD = $(progs_ldadd)
-
-gdbus_introspection_SOURCES = gdbus-introspection.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
-gdbus_introspection_LDADD = $(progs_ldadd)
-
-gdbus_threading_SOURCES = gdbus-threading.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
-gdbus_threading_LDADD = $(progs_ldadd)
-
-gdbus_export_SOURCES = gdbus-export.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
-gdbus_export_LDADD = $(progs_ldadd)
-
-gdbus_error_SOURCES = gdbus-error.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
-gdbus_error_LDADD = $(progs_ldadd)
-
-gdbus_non_socket_SOURCES = \
-       gdbus-non-socket.c \
-       gdbus-tests.c \
-       gdbus-tests.h \
-       test-io-stream.c \
-       test-io-stream.h \
-       test-pipe-unix.c \
-       test-pipe-unix.h \
-       $(NULL)
-gdbus_non_socket_LDADD = $(progs_ldadd)
-
-gdbus_exit_on_close_SOURCES = gdbus-exit-on-close.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h gdbus-tests.c
-gdbus_exit_on_close_LDADD = $(progs_ldadd)
-
-gdbus_example_watch_name_SOURCES = gdbus-example-watch-name.c
-gdbus_example_watch_name_LDADD   = $(progs_ldadd)
-
-gdbus_example_watch_proxy_SOURCES = gdbus-example-watch-proxy.c
-gdbus_example_watch_proxy_LDADD   = $(progs_ldadd)
-
-gdbus_example_own_name_SOURCES = gdbus-example-own-name.c
-gdbus_example_own_name_LDADD   = $(progs_ldadd)
-
-gdbus_example_server_SOURCES = gdbus-example-server.c
-gdbus_example_server_LDADD   = $(progs_ldadd)
-
-gdbus_example_unix_fd_client_SOURCES = gdbus-example-unix-fd-client.c
-gdbus_example_unix_fd_client_LDADD   = $(progs_ldadd)
-
-gdbus_example_subtree_SOURCES = gdbus-example-subtree.c
-gdbus_example_subtree_LDADD   = $(progs_ldadd)
-
-gdbus_example_peer_SOURCES = gdbus-example-peer.c
-gdbus_example_peer_LDADD   = $(progs_ldadd)
-
-gdbus_example_proxy_subclass_SOURCES = gdbus-example-proxy-subclass.c
-gdbus_example_proxy_subclass_LDADD   = $(progs_ldadd)
-
-gdbus_example_export_SOURCES = gdbus-example-export.c
-gdbus_example_export_LDADD   = $(progs_ldadd)
-
-gdbus_connection_flush_helper_SOURCES = gdbus-connection-flush-helper.c
-gdbus_connection_flush_helper_LDADD = $(progs_ldadd)
-
-appinfo_SOURCES = appinfo.c
-appinfo_LDADD   = $(progs_ldadd)
-
-resources_SOURCES = resources.c test_resources.c test_resources2.c test_resources2.h
-resources_LDADD   = $(progs_ldadd)
-
-appinfo_test_SOURCES = appinfo-test.c
-appinfo_test_LDADD   = $(progs_ldadd)
-
-contenttype_SOURCES = contenttype.c
-contenttype_LDADD   = $(progs_ldadd)
-
-mimeapps_SOURCES = mimeapps.c
-mimeapps_LDADD   = $(progs_ldadd)
-
-file_SOURCES = file.c
-file_LDADD   = $(progs_ldadd)
-
-fileattributematcher_SOURCES = fileattributematcher.c
-fileattributematcher_LDADD   = $(progs_ldadd)
-
-gapplication_SOURCES = gapplication.c gdbus-sessionbus.c
-gapplication_LDADD = $(progs_ldadd)
-
-basic_application_LDADD = $(progs_ldadd)
-
-gapplication_example_open_SOURCES = gapplication-example-open.c
-gapplication_example_open_LDADD   = $(progs_ldadd)
-
-gapplication_example_cmdline_SOURCES = gapplication-example-cmdline.c
-gapplication_example_cmdline_LDADD   = $(progs_ldadd)
-
-gapplication_example_cmdline2_SOURCES = gapplication-example-cmdline2.c
-gapplication_example_cmdline2_LDADD   = $(progs_ldadd)
-
-gapplication_example_cmdline3_SOURCES = gapplication-example-cmdline3.c
-gapplication_example_cmdline3_LDADD   = $(progs_ldadd)
-
-gapplication_example_actions_SOURCES = gapplication-example-actions.c
-gapplication_example_actions_LDADD   = $(progs_ldadd)
-
-gmenumodel_LDADD = $(progs_ldadd)
-
-schema_tests = \
-       schema-tests/array-default-not-in-choices.gschema.xml           \
-       schema-tests/bad-choice.gschema.xml                             \
-       schema-tests/bad-key.gschema.xml                                \
-       schema-tests/bad-key2.gschema.xml                               \
-       schema-tests/bad-key3.gschema.xml                               \
-       schema-tests/bad-key4.gschema.xml                               \
-       schema-tests/bad-type.gschema.xml                               \
-       schema-tests/bare-alias.gschema.xml                             \
-       schema-tests/choice-alias.gschema.xml                           \
-       schema-tests/choice-bad.gschema.xml                             \
-       schema-tests/choice-badtype.gschema.xml                         \
-       schema-tests/choice-invalid-alias.gschema.xml                   \
-       schema-tests/choice-missing-value.gschema.xml                   \
-       schema-tests/choice-shadowed-alias.gschema.xml                  \
-       schema-tests/choice-upside-down.gschema.xml                     \
-       schema-tests/choice.gschema.xml                                 \
-       schema-tests/choices-wrong-type.gschema.xml                     \
-       schema-tests/default-in-aliases.gschema.xml                     \
-       schema-tests/default-not-in-choices.gschema.xml                 \
-       schema-tests/default-out-of-range.gschema.xml                   \
-       schema-tests/empty-key.gschema.xml                              \
-       schema-tests/enum-with-aliases.gschema.xml                      \
-       schema-tests/enum-with-bad-default.gschema.xml                  \
-       schema-tests/enum-with-chained-alias.gschema.xml                \
-       schema-tests/enum-with-choice.gschema.xml                       \
-       schema-tests/enum-with-invalid-alias.gschema.xml                \
-       schema-tests/enum-with-repeated-alias.gschema.xml               \
-       schema-tests/enum-with-repeated-nick.gschema.xml                \
-       schema-tests/enum-with-repeated-value.gschema.xml               \
-       schema-tests/enum-with-shadow-alias.gschema.xml                 \
-       schema-tests/enum.gschema.xml                                   \
-       schema-tests/flags-aliased-default.gschema.xml                  \
-       schema-tests/flags-bad-default.gschema.xml                      \
-       schema-tests/flags-more-than-one-bit.gschema.xml                \
-       schema-tests/flags-with-enum-attr.gschema.xml                   \
-       schema-tests/flags-with-enum-tag.gschema.xml                    \
-       schema-tests/extend-and-shadow-indirect.gschema.xml             \
-       schema-tests/extend-and-shadow.gschema.xml                      \
-       schema-tests/extend-missing.gschema.xml                         \
-       schema-tests/extend-nonlist.gschema.xml                         \
-       schema-tests/extend-self.gschema.xml                            \
-       schema-tests/extend-wrong-list-indirect.gschema.xml             \
-       schema-tests/extend-wrong-list.gschema.xml                      \
-       schema-tests/extending.gschema.xml                              \
-       schema-tests/from-docs.gschema.xml                              \
-       schema-tests/incomplete-list.gschema.xml                        \
-       schema-tests/inherit-gettext-domain.gschema.xml                 \
-       schema-tests/invalid-path.gschema.xml                           \
-       schema-tests/key-in-list-indirect.gschema.xml                   \
-       schema-tests/key-in-list.gschema.xml                            \
-       schema-tests/list-of-missing.gschema.xml                        \
-       schema-tests/missing-quotes.gschema.xml                         \
-       schema-tests/no-default.gschema.xml                             \
-       schema-tests/overflow.gschema.xml                               \
-       schema-tests/override-missing.gschema.xml                       \
-       schema-tests/override-range-error.gschema.xml                   \
-       schema-tests/override-then-key.gschema.xml                      \
-       schema-tests/override-twice.gschema.xml                         \
-       schema-tests/override-type-error.gschema.xml                    \
-       schema-tests/override.gschema.xml                               \
-       schema-tests/range-badtype.gschema.xml                          \
-       schema-tests/range-default-high.gschema.xml                     \
-       schema-tests/range-default-low.gschema.xml                      \
-       schema-tests/range-high-default.gschema.xml                     \
-       schema-tests/range-low-default.gschema.xml                      \
-       schema-tests/range-missing-max.gschema.xml                      \
-       schema-tests/range-missing-min.gschema.xml                      \
-       schema-tests/range-parse-error.gschema.xml                      \
-       schema-tests/range-wrong-type.gschema.xml                       \
-       schema-tests/range.gschema.xml                                  \
-       schema-tests/wrong-category.gschema.xml
-
-proxy_SOURCES = proxy.c
-proxy_LDADD   = $(progs_ldadd) \
-       $(top_builddir)/gthread/libgthread-2.0.la
-
-tls_certificate_SOURCES = tls-certificate.c gtesttlsbackend.c gtesttlsbackend.h
-tls_certificate_LDADD   = $(progs_ldadd)
-
-tls_interaction_LDADD = $(progs_ldadd)
-
-cancellable_LDADD = $(progs_ldadd)
-
-vfs_LDADD = $(progs_ldadd)
-
-network_monitor_LDADD = $(progs_ldadd)
+tls_interaction_SOURCES = tls-interaction.c gtesttlsbackend.c gtesttlsbackend.h
 
 # -----------------------------------------------------------------------------
 
-if OS_UNIX
-gdbus_example_objectmanager_server_SOURCES  = gdbus-example-objectmanager-server.c
-gdbus_example_objectmanager_server_CFLAGS   = -I$(top_builddir)/gio/tests/gdbus-object-manager-example
-gdbus_example_objectmanager_server_LDADD    = $(top_builddir)/gio/tests/gdbus-object-manager-example/libgdbus-example-objectmanager.la $(progs_ldadd)
-
-gdbus_example_objectmanager_client_SOURCES  = gdbus-example-objectmanager-client.c
-gdbus_example_objectmanager_client_CFLAGS   = -I$(top_builddir)/gio/tests/gdbus-object-manager-example
-gdbus_example_objectmanager_client_LDADD    = $(top_builddir)/gio/tests/gdbus-object-manager-example/libgdbus-example-objectmanager.la $(progs_ldadd)
+if OS_WIN32
+test_programs += win32-streams
+endif
 
-gdbus_peer_SOURCES = gdbus-peer.c gdbus-tests.h gdbus-tests.c
-gdbus_peer_CFLAGS  = -I$(top_builddir)/gio/tests/gdbus-object-manager-example
-gdbus_peer_LDADD   = $(top_builddir)/gio/tests/gdbus-object-manager-example/libgdbus-example-objectmanager.la $(progs_ldadd)
+if PLATFORM_WIN32
+no_undefined = -no-undefined
+endif
 
-endif OS_UNIX
+if HAVE_DBUS1
+test_programs += gdbus-serialization
+gdbus_serialization_CFLAGS = $(AM_CFLAGS) $(DBUS1_CFLAGS)
+gdbus_serialization_LDADD = $(LDADD) $(DBUS1_LIBS)
+gdbus_serialization_SOURCES = \
+       gdbus-serialization.c                   \
+       gdbus-tests.h                           \
+       gdbus-tests.c
+endif
 
 # -----------------------------------------------------------------------------
+#  The resources test is a bit more complicated...
 
-EXTRA_DIST += \
-       socket-common.c                 \
-       org.gtk.test.gschema            \
-       org.gtk.test.gschema.xml        \
-       testenum.h                      \
-       enums.xml.template              \
-       de.po                           \
-       $(schema_tests)                 \
-       org.gtk.schemasourcecheck.gschema.xml \
-       appinfo-test.desktop            \
-       appinfo-test2.desktop           \
-       appinfo-test-gnome.desktop      \
-       appinfo-test-notgnome.desktop   \
-       gdbus-testserver.py             \
-       test-codegen.xml                \
-       cert1.pem                       \
-       cert2.pem                       \
-       cert3.pem                       \
-       key.pem                         \
-       key8.pem                        \
-       key-cert.pem                    \
-       cert-key.pem                    \
-       cert-list.pem                   \
-       nothing.pem                     \
-       test.gresource.xml              \
-       test2.gresource.xml             \
-       $(NULL)
+test_programs += resources
+resources_SOURCES = resources.c
+nodist_resources_SOURCES = test_resources.c test_resources2.c test_resources2.h
+resources_DEPENDENCIES = test.gresource
 
-MISC_STUFF = test.mo test.gresource
+test_ltlibraries += libresourceplugin.la
+libresourceplugin_la_SOURCES = resourceplugin.c plugin_resources.c
+libresourceplugin_la_LDFLAGS = -avoid-version -module -export-dynamic $(no_undefined)
+libresourceplugin_la_LIBADD = $(LDADD)
+
+# libtool contains a bug whereby the created .la file doesn't contain the correct dlname='' in the case that
+# you're building a library but not installing it.  This is apparently because the only considered use for an
+# uninstalled library is as a convenience library for linking (despite the fact that we give -module).  The lack
+# of dlname='' in the .la trips up libltdl and GModule as well.  We can trick libtool into believing that we
+# will install the module by giving it a bogus -rpath for the uninstalled cases.
+#
+# See http://lists.gnu.org/archive/html/bug-libtool/2013-05/msg00009.html
+if !ENABLE_INSTALLED_TESTS
+libresourceplugin_la_LDFLAGS += -rpath /
+endif
 
-test.mo: de.po
-       $(MSGFMT) -o test.mo $(srcdir)/de.po; \
-       $(MKDIR_P) de/LC_MESSAGES; \
-       cp -f test.mo de/LC_MESSAGES
+if CROSS_COMPILING
+  glib_compile_resources=$(GLIB_COMPILE_RESOURCES)
+else
+  glib_compile_resources=$(top_builddir)/gio/glib-compile-resources
+endif
 
-BUILT_SOURCES += test_resources.c test_resources2.c test_resources2.h
-test_resources.c: test2.gresource.xml test1.txt
-       $(top_builddir)/gio/glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source --c-name _g_test1 $(srcdir)/test2.gresource.xml
+resources.o: test_resources2.h
+test_resources.c: test2.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test2.gresource.xml)
+       $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate-source --c-name _g_test1 $<
 
-test_resources2.c: test3.gresource.xml test1.txt
-       $(top_builddir)/gio/glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source --c-name _g_test2 --manual-register $(srcdir)/test3.gresource.xml
+test_resources2.h test_resources2.c: test3.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test3.gresource.xml)
+       $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate --c-name _g_test2 --manual-register $<
 
-test_resources2.h: test3.gresource.xml
-       $(top_builddir)/gio/glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-header --c-name _g_test2 --manual-register $(srcdir)/test3.gresource.xml
+plugin_resources.c: test4.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test4.gresource.xml)
+       $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate-source --c-name _g_plugin $<
 
-plugin_resources.c: test4.gresource.xml test1.txt
-       $(top_builddir)/gio/glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source --c-name _g_plugin $(srcdir)/test4.gresource.xml
+test.gresource: test.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test.gresource.xml)
+       $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) $<
 
-test.gresource: test.gresource.xml test1.txt test2.txt test3.txt
-       $(top_builddir)/gio/glib-compile-resources --target=$@ --sourcedir=$(srcdir) $(srcdir)/test.gresource.xml
+EXTRA_DIST += test.gresource.xml test1.txt test2.gresource.xml test2.txt test3.gresource.xml test3.txt test4.gresource.xml
 
-noinst_LTLIBRARIES = libresourceplugin.la
+CLEANFILES += test_resources.c test_resources2.[ch] plugin_resources.c test.gresource
 
-libresourceplugin_la_SOURCES = resourceplugin.c plugin_resources.c
-libresourceplugin_la_LDFLAGS = $(G_MODULE_LDFLAGS) -avoid-version -module $(no_undefined) -rpath $(libdir)
-libresourceplugin_la_LIBADD = $(G_MODULE_LIBS)
+BUILT_SOURCES += giotypefuncs.c
 
-CLEANFILES = gdbus-test-codegen-generated.[ch] gdbus-test-codegen-generated-doc-*.xml
+giotypefuncs.c: Makefile
+       $(AM_V_GEN) echo '#include <gio/gio.h>' > xgen-giosrc.c && \
+         echo "G_GNUC_BEGIN_IGNORE_DEPRECATIONS" > xgen-gio && \
+         ${CPP} $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) xgen-giosrc.c | \
+         $(GREP) -o '\bg_.*_get_type\b' | \
+         $(GREP) -v 'g_io_extension_get_type\|g_variant_get_type' | \
+         sort | uniq | \
+         $(SED) -e 's/^/*tp++ = /' -e 's/$$/ ();/' >> xgen-gio && \
+         cp xgen-gio $@ # && rm -f xgen-gio xgen-giosrc.c
 
-DISTCLEANFILES = \
-       applications/mimeinfo.cache     \
-       org.gtk.test.enums.xml          \
-       de/LC_MESSAGES/test.mo          \
-       test.mo                         \
-       test.gresource                  \
-       test_resources.c                \
-       gsettings.store                 \
-       gschemas.compiled               \
-       schema-source/gschemas.compiled
+CLEANFILES += xgen-giosrc.c xgen-gio giotypefuncs.c
 
-distclean-local:
-       rm -r xdgdatahome xdgdatadir
+if ENABLE_INSTALLED_TESTS
+install-data-hook:
+       $(AM_V_at) chmod a+x $(DESTDIR)$(installed_testdir)/x-content/win32-software/autorun.exe
+endif