2018-04-20 18:09:32 +02:00
|
|
|
common_gio_tests_deps = [
|
|
|
|
libglib_dep,
|
|
|
|
libgmodule_dep,
|
|
|
|
libgobject_dep,
|
|
|
|
libgio_dep,
|
|
|
|
]
|
2017-12-11 02:33:24 +01:00
|
|
|
|
2018-11-09 19:23:43 +01:00
|
|
|
test_c_args = [
|
|
|
|
'-DG_LOG_DOMAIN="GLib-GIO"',
|
|
|
|
'-DGLIB_MKENUMS="@0@"'.format(glib_mkenums),
|
|
|
|
'-DGLIB_COMPILE_SCHEMAS="@0@"'.format(glib_compile_schemas.full_path()),
|
2019-03-05 11:55:19 +01:00
|
|
|
'-UG_DISABLE_ASSERT',
|
2018-11-09 19:23:43 +01:00
|
|
|
]
|
|
|
|
|
2022-03-19 12:16:46 +01:00
|
|
|
libutil_dep = dependency('', required : false)
|
2021-03-02 14:15:50 +01:00
|
|
|
|
2022-03-19 12:16:46 +01:00
|
|
|
if cc.has_header('pty.h')
|
|
|
|
have_openpty = cc.has_function('openpty', prefix : '#include <pty.h>')
|
|
|
|
|
|
|
|
if host_machine.system() == 'linux' and not have_openpty
|
|
|
|
libutil_dep = cc.find_library('util', required : false)
|
|
|
|
have_openpty = cc.has_function('openpty', dependencies : libutil_dep, prefix : '#include <pty.h>')
|
|
|
|
endif
|
|
|
|
|
|
|
|
if have_openpty
|
|
|
|
test_c_args += '-DHAVE_OPENPTY'
|
|
|
|
endif
|
|
|
|
endif
|
2021-03-02 14:15:50 +01:00
|
|
|
|
2022-09-13 18:26:40 +02:00
|
|
|
test_cpp_args = test_c_args
|
|
|
|
|
2018-09-09 14:46:33 +02:00
|
|
|
if host_machine.system() == 'windows'
|
|
|
|
common_gio_tests_deps += [iphlpapi_dep, winsock2, cc.find_library ('secur32')]
|
|
|
|
endif
|
|
|
|
|
2017-01-28 13:52:18 +01:00
|
|
|
subdir('gdbus-object-manager-example')
|
|
|
|
|
|
|
|
gengiotypefuncs_prog = find_program('gengiotypefuncs.py')
|
|
|
|
giotypefuncs_inc = custom_target(
|
|
|
|
'giotypefuncs.inc',
|
|
|
|
output : 'giotypefuncs.inc',
|
|
|
|
input : gio_headers + [gioenumtypes_h] + gobject_install_headers,
|
|
|
|
command: [gengiotypefuncs_prog, '@OUTPUT@', '@INPUT@'])
|
|
|
|
|
2022-10-25 18:45:46 +02:00
|
|
|
if glib_build_shared
|
|
|
|
subdir('modules')
|
|
|
|
endif
|
|
|
|
|
2016-03-07 12:13:24 +01:00
|
|
|
# Test programs buildable on all platforms
|
2018-09-24 16:25:37 +02:00
|
|
|
gio_tests = {
|
2022-02-18 00:01:35 +01:00
|
|
|
'appmonitor' : {
|
|
|
|
# FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
|
2022-10-19 23:52:13 +02:00
|
|
|
'can_fail' : host_system == 'darwin',
|
2022-02-18 00:01:35 +01:00
|
|
|
},
|
2018-08-15 18:25:14 +02:00
|
|
|
'async-close-output-stream' : {},
|
|
|
|
'async-splice-output-stream' : {},
|
|
|
|
'buffered-input-stream' : {},
|
|
|
|
'buffered-output-stream' : {},
|
|
|
|
'cancellable' : {},
|
|
|
|
'contexts' : {},
|
2022-02-18 00:01:35 +01:00
|
|
|
'contenttype' : {
|
|
|
|
# FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 / https://gitlab.gnome.org/GNOME/glib/-/issues/1251
|
2022-10-19 23:52:13 +02:00
|
|
|
'can_fail' : host_system == 'darwin',
|
2022-02-18 00:01:35 +01:00
|
|
|
},
|
2018-08-15 18:25:14 +02:00
|
|
|
'converter-stream' : {},
|
|
|
|
'credentials' : {},
|
|
|
|
'data-input-stream' : {},
|
|
|
|
'data-output-stream' : {},
|
2022-06-14 18:22:19 +02:00
|
|
|
'error': {},
|
2022-10-11 17:47:24 +02:00
|
|
|
'file-thumbnail' : {},
|
2018-08-15 18:25:14 +02:00
|
|
|
'fileattributematcher' : {},
|
|
|
|
'filter-streams' : {},
|
2022-10-25 18:45:46 +02:00
|
|
|
'giomodule' : {
|
|
|
|
'depends' : glib_build_shared ? [libtestmodulea, libtestmoduleb] : [],
|
|
|
|
},
|
2022-10-20 12:41:03 +02:00
|
|
|
'gsubprocess' : {
|
|
|
|
'suite': host_system == 'windows' ? ['flaky'] : [],
|
2022-10-25 01:57:36 +02:00
|
|
|
'extra_programs': ['gsubprocess-testprog'],
|
2022-10-20 12:41:03 +02:00
|
|
|
},
|
2018-08-15 18:25:14 +02:00
|
|
|
'g-file' : {},
|
2022-10-19 21:34:48 +02:00
|
|
|
'g-file-info' : {
|
2022-10-19 21:34:48 +02:00
|
|
|
'can_fail' : host_system == 'windows' and cc.get_id() != 'gcc',
|
2022-10-19 21:34:48 +02:00
|
|
|
},
|
2018-08-15 18:25:14 +02:00
|
|
|
'g-icon' : {},
|
|
|
|
'gdbus-addresses' : {},
|
|
|
|
'gdbus-message' : {},
|
2022-04-07 18:03:51 +02:00
|
|
|
'gdbus-peer' : {
|
|
|
|
'dependencies' : [libgdbus_example_objectmanager_dep],
|
|
|
|
'install_rpath' : installed_tests_execdir,
|
|
|
|
# FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
|
2022-10-19 23:52:13 +02:00
|
|
|
'can_fail' : host_system in ['darwin', 'windows'],
|
2022-04-07 18:03:51 +02:00
|
|
|
},
|
2018-08-15 18:25:14 +02:00
|
|
|
'inet-address' : {},
|
|
|
|
'io-stream' : {},
|
2022-10-27 13:58:53 +02:00
|
|
|
'max-version' : {'install' : false},
|
2018-08-15 18:25:14 +02:00
|
|
|
'memory-input-stream' : {},
|
2019-09-19 16:21:23 +02:00
|
|
|
'memory-monitor' : {},
|
2018-08-15 18:25:14 +02:00
|
|
|
'memory-output-stream' : {},
|
2022-07-15 00:07:38 +02:00
|
|
|
'memory-settings-backend' : {},
|
2018-08-15 18:25:14 +02:00
|
|
|
'mount-operation' : {},
|
2022-03-04 20:07:02 +01:00
|
|
|
'network-address' : {'extra_sources': ['mock-resolver.c']},
|
2018-08-15 18:25:14 +02:00
|
|
|
'network-monitor' : {},
|
|
|
|
'network-monitor-race' : {},
|
2022-07-15 00:07:38 +02:00
|
|
|
'null-settings-backend' : {},
|
2018-08-15 18:25:14 +02:00
|
|
|
'permission' : {},
|
2022-03-19 12:16:46 +01:00
|
|
|
'pollable' : {'dependencies' : [libutil_dep]},
|
2021-07-20 23:04:31 +02:00
|
|
|
'power-profile-monitor' : {},
|
2018-08-15 18:25:14 +02:00
|
|
|
'proxy-test' : {},
|
|
|
|
'readwrite' : {},
|
2022-10-31 12:07:52 +01:00
|
|
|
'sandbox' : {
|
2022-11-24 05:33:30 +01:00
|
|
|
'extra_sources': ['../gsandbox.c', 'portal-support-utils.c'],
|
2022-11-24 19:07:27 +01:00
|
|
|
'c_args': ['-DG_PORTAL_SUPPORT_TEST'],
|
2022-10-31 12:07:52 +01:00
|
|
|
},
|
2018-08-15 18:25:14 +02:00
|
|
|
'simple-async-result' : {},
|
|
|
|
'simple-proxy' : {},
|
|
|
|
'sleepy-stream' : {},
|
2022-02-18 00:01:35 +01:00
|
|
|
'socket' : {
|
|
|
|
# FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
|
2022-10-19 23:52:13 +02:00
|
|
|
'can_fail' : host_system == 'darwin',
|
2022-02-18 00:01:35 +01:00
|
|
|
},
|
2018-08-15 18:25:14 +02:00
|
|
|
'socket-listener' : {},
|
2019-02-21 19:13:47 +01:00
|
|
|
'socket-service' : {},
|
2018-08-15 18:25:14 +02:00
|
|
|
'srvtarget' : {},
|
|
|
|
'task' : {},
|
|
|
|
'vfs' : {},
|
|
|
|
'volumemonitor' : {},
|
|
|
|
'glistmodel' : {},
|
2019-01-09 11:48:42 +01:00
|
|
|
'testfilemonitor' : {'suite' : ['slow', 'flaky']},
|
2018-08-15 18:25:14 +02:00
|
|
|
'thumbnail-verification' : {},
|
|
|
|
'tls-certificate' : {'extra_sources' : ['gtesttlsbackend.c']},
|
|
|
|
'tls-interaction' : {'extra_sources' : ['gtesttlsbackend.c']},
|
2018-08-16 15:25:29 +02:00
|
|
|
'tls-database' : {'extra_sources' : ['gtesttlsbackend.c']},
|
2021-06-03 14:01:29 +02:00
|
|
|
'tls-bindings' : {'extra_sources' : ['gtesttlsbackend.c']},
|
2022-04-07 17:00:32 +02:00
|
|
|
'unix-fd' : {},
|
2022-02-18 00:01:35 +01:00
|
|
|
'gdbus-address-get-session' : {
|
2022-10-25 17:25:09 +02:00
|
|
|
'extra_programs': host_system != 'windows' ? ['dbus-launch'] : [],
|
2022-02-18 00:01:35 +01:00
|
|
|
# FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
|
2022-10-19 23:52:13 +02:00
|
|
|
'can_fail' : host_system == 'darwin',
|
2022-02-18 00:01:35 +01:00
|
|
|
},
|
2019-11-29 17:48:32 +01:00
|
|
|
'win32-appinfo' : {},
|
2018-09-24 16:25:37 +02:00
|
|
|
}
|
2018-08-15 18:25:14 +02:00
|
|
|
|
2022-07-15 08:23:37 +02:00
|
|
|
if have_cxx
|
|
|
|
gio_tests += {
|
|
|
|
'cxx' : {
|
|
|
|
'source' : ['cxx.cpp'],
|
2022-09-13 18:26:40 +02:00
|
|
|
'suite': ['C++'],
|
2022-07-15 08:23:37 +02:00
|
|
|
},
|
|
|
|
}
|
2022-09-13 18:26:40 +02:00
|
|
|
|
|
|
|
foreach std, arg: cxx_standards
|
|
|
|
gio_tests += {
|
|
|
|
'cxx-@0@'.format(std) : {
|
|
|
|
'source' : ['cxx.cpp'],
|
|
|
|
'suite' : ['cpp'],
|
|
|
|
'cpp_args' : [arg],
|
|
|
|
},
|
|
|
|
}
|
|
|
|
endforeach
|
2022-07-15 08:23:37 +02:00
|
|
|
endif
|
|
|
|
|
2018-09-24 16:25:37 +02:00
|
|
|
test_extra_programs = {
|
2018-08-15 18:25:14 +02:00
|
|
|
'gdbus-connection-flush-helper' : {},
|
|
|
|
'gdbus-testserver' : {},
|
2018-09-19 17:53:07 +02:00
|
|
|
'gsubprocess-testprog' : {},
|
2018-09-24 16:25:37 +02:00
|
|
|
}
|
2016-03-07 12:13:24 +01:00
|
|
|
|
2022-10-19 20:08:15 +02:00
|
|
|
python_tests = {
|
2022-10-19 21:33:19 +02:00
|
|
|
# FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/2764
|
|
|
|
'codegen.py' : { 'can_fail' : host_system == 'freebsd' },
|
2022-10-19 20:08:15 +02:00
|
|
|
}
|
2019-12-02 15:05:22 +01:00
|
|
|
|
2022-10-20 02:24:04 +02:00
|
|
|
test_env = environment()
|
2018-07-16 17:52:53 +02:00
|
|
|
test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
|
|
|
|
test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
|
|
|
|
test_env.set('GIO_MODULE_DIR', '')
|
2022-07-14 16:56:28 +02:00
|
|
|
|
|
|
|
if host_system != 'windows' and not glib_have_cocoa
|
|
|
|
test_env.set('GIO_LAUNCH_DESKTOP', gio_launch_desktop.full_path())
|
|
|
|
endif
|
2017-02-23 17:13:23 +01:00
|
|
|
|
|
|
|
# Check for libdbus1 - Optional - is only used in the GDBus test cases
|
|
|
|
# 1.2.14 required for dbus_message_set_serial
|
|
|
|
dbus1_dep = dependency('dbus-1', required : false, version : '>= 1.2.14')
|
2017-08-15 11:08:47 +02:00
|
|
|
if not dbus1_dep.found()
|
2019-07-09 18:22:51 +02:00
|
|
|
if cc.get_id() == 'msvc' or cc.get_id() == 'clang-cl'
|
2017-08-15 11:08:47 +02:00
|
|
|
# MSVC: Search for the DBus library by the configuration, which corresponds
|
|
|
|
# to the output of CMake builds of DBus. Note that debugoptimized
|
|
|
|
# is really a Release build with .PDB files.
|
2020-03-12 13:12:27 +01:00
|
|
|
if vs_crt == 'debug'
|
2017-08-15 11:08:47 +02:00
|
|
|
dbus1_dep = cc.find_library('dbus-1d', required : false)
|
|
|
|
else
|
|
|
|
dbus1_dep = cc.find_library('dbus-1', required : false)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
2017-02-23 17:13:23 +01:00
|
|
|
if dbus1_dep.found()
|
|
|
|
glib_conf.set('HAVE_DBUS1', 1)
|
|
|
|
|
2018-09-24 16:25:37 +02:00
|
|
|
gio_tests += {
|
2018-08-15 18:25:14 +02:00
|
|
|
'gdbus-serialization' : {
|
|
|
|
'extra_sources' : ['gdbus-tests.c'],
|
|
|
|
'dependencies' : [dbus1_dep],
|
2019-10-11 20:02:55 +02:00
|
|
|
},
|
|
|
|
'gdbus-server-auth' : {
|
|
|
|
'dependencies' : [dbus1_dep],
|
|
|
|
},
|
|
|
|
}
|
|
|
|
else
|
|
|
|
# We can build a cut-down version of this test without libdbus
|
|
|
|
gio_tests += {
|
|
|
|
'gdbus-server-auth' : {},
|
2018-09-24 16:25:37 +02:00
|
|
|
}
|
2017-02-23 17:13:23 +01:00
|
|
|
endif
|
|
|
|
|
2022-01-22 12:30:13 +01:00
|
|
|
have_dbus_daemon = find_program('dbus-daemon', required : false).found()
|
|
|
|
if have_dbus_daemon
|
|
|
|
gio_tests += {
|
|
|
|
'debugcontroller' : {},
|
|
|
|
'defaultvalue' : {'extra_sources' : [giotypefuncs_inc]},
|
|
|
|
}
|
|
|
|
endif
|
|
|
|
|
2016-03-07 12:13:24 +01:00
|
|
|
# Test programs buildable on UNIX only
|
|
|
|
if host_machine.system() != 'windows'
|
2018-09-24 16:25:37 +02:00
|
|
|
gio_tests += {
|
2018-08-15 18:25:14 +02:00
|
|
|
'file' : {},
|
|
|
|
'gdbus-peer-object-manager' : {},
|
2022-07-18 18:22:34 +02:00
|
|
|
'gdbus-sasl' : {},
|
2018-08-15 18:25:14 +02:00
|
|
|
'live-g-file' : {},
|
2022-11-24 19:07:27 +01:00
|
|
|
'portal-support-flatpak-none' : {
|
|
|
|
'extra_sources': ['../gportalsupport.c', '../gsandbox.c', 'portal-support-utils.c'],
|
|
|
|
'c_args': ['-DG_PORTAL_SUPPORT_TEST'],
|
|
|
|
'suite': ['portal-support'],
|
|
|
|
},
|
|
|
|
'portal-support-flatpak-full' : {
|
|
|
|
'extra_sources': ['../gportalsupport.c', '../gsandbox.c', 'portal-support-utils.c'],
|
|
|
|
'c_args': ['-DG_PORTAL_SUPPORT_TEST'],
|
|
|
|
'suite': ['portal-support'],
|
|
|
|
},
|
|
|
|
'portal-support-flatpak-network-only' : {
|
|
|
|
'extra_sources': ['../gportalsupport.c', '../gsandbox.c', 'portal-support-utils.c'],
|
|
|
|
'c_args': ['-DG_PORTAL_SUPPORT_TEST'],
|
|
|
|
'suite': ['portal-support'],
|
|
|
|
},
|
|
|
|
'portal-support-flatpak-gsettings-only' : {
|
|
|
|
'extra_sources': ['../gportalsupport.c', '../gsandbox.c', 'portal-support-utils.c'],
|
|
|
|
'c_args': ['-DG_PORTAL_SUPPORT_TEST'],
|
|
|
|
'suite': ['portal-support'],
|
|
|
|
},
|
2022-11-24 05:27:27 +01:00
|
|
|
'portal-support-none' : {
|
|
|
|
'extra_sources': ['../gportalsupport.c', '../gsandbox.c'],
|
2022-11-24 05:54:07 +01:00
|
|
|
'c_args': ['-DG_PORTAL_SUPPORT_TEST'],
|
2022-11-24 05:27:27 +01:00
|
|
|
'suite': ['portal-support'],
|
|
|
|
},
|
|
|
|
'portal-support-env-var' : {
|
|
|
|
'extra_sources': ['../gportalsupport.c', '../gsandbox.c'],
|
|
|
|
'suite': ['portal-support'],
|
|
|
|
},
|
|
|
|
'portal-support-snap' : {
|
|
|
|
'extra_sources': ['../gportalsupport.c', '../gsandbox.c', 'portal-support-utils.c'],
|
2022-11-24 05:54:07 +01:00
|
|
|
'c_args': ['-DG_PORTAL_SUPPORT_TEST'],
|
2022-11-24 05:27:27 +01:00
|
|
|
'suite': ['portal-support'],
|
|
|
|
},
|
|
|
|
'portal-support-snap-classic' : {
|
|
|
|
'extra_sources': ['../gportalsupport.c', '../gsandbox.c', 'portal-support-utils.c'],
|
2022-11-24 05:54:07 +01:00
|
|
|
'c_args': ['-DG_PORTAL_SUPPORT_TEST'],
|
2022-11-24 05:27:27 +01:00
|
|
|
'suite': ['portal-support'],
|
|
|
|
},
|
2022-03-18 15:22:38 +01:00
|
|
|
'resolver-parsing' : {'dependencies' : [network_libs]},
|
2018-08-15 18:25:14 +02:00
|
|
|
'socket-address' : {},
|
|
|
|
'stream-rw_all' : {},
|
|
|
|
'unix-mounts' : {},
|
|
|
|
'unix-streams' : {},
|
|
|
|
'g-file-info-filesystem-readonly' : {},
|
|
|
|
'gschema-compile' : {'install' : false},
|
|
|
|
'trash' : {},
|
2018-09-24 16:25:37 +02:00
|
|
|
}
|
2017-02-24 10:46:36 +01:00
|
|
|
|
2021-01-29 21:24:03 +01:00
|
|
|
# LD_PRELOAD modules don't work so well with AddressSanitizer
|
2022-10-20 00:51:34 +02:00
|
|
|
if have_rtld_next and glib_build_shared and get_option('b_sanitize') == 'none'
|
2019-03-20 19:52:48 +01:00
|
|
|
gio_tests += {
|
|
|
|
'gsocketclient-slow' : {
|
|
|
|
'depends' : [
|
|
|
|
shared_library('slow-connect-preload',
|
|
|
|
'slow-connect-preload.c',
|
|
|
|
name_prefix : '',
|
2019-08-29 17:19:08 +02:00
|
|
|
dependencies: libdl_dep,
|
2019-03-20 19:52:48 +01:00
|
|
|
install_dir : installed_tests_execdir,
|
2022-09-20 17:00:10 +02:00
|
|
|
install_tag : 'tests',
|
2019-03-20 19:52:48 +01:00
|
|
|
install: installed_tests_enabled,
|
|
|
|
)
|
|
|
|
],
|
|
|
|
'env' : {
|
|
|
|
'LD_PRELOAD': '@0@/slow-connect-preload.so'.format(meson.current_build_dir())
|
|
|
|
},
|
|
|
|
'installed_tests_env' : {
|
|
|
|
'LD_PRELOAD': '@0@/slow-connect-preload.so'.format(installed_tests_execdir),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
endif
|
|
|
|
|
2017-02-24 10:46:36 +01:00
|
|
|
# Uninstalled because of the check-for-executable logic in DesktopAppInfo
|
|
|
|
# unable to find the installed executable
|
2017-05-13 12:10:52 +02:00
|
|
|
if not glib_have_cocoa
|
2018-09-24 16:25:37 +02:00
|
|
|
gio_tests += {
|
2018-08-15 18:25:14 +02:00
|
|
|
'appinfo' : {
|
|
|
|
'install' : false,
|
2022-10-24 22:19:21 +02:00
|
|
|
'extra_programs' : ['appinfo-test'],
|
2018-08-15 18:25:14 +02:00
|
|
|
},
|
|
|
|
'desktop-app-info' : {
|
|
|
|
'install' : false,
|
2022-10-24 22:15:11 +02:00
|
|
|
'depends' : gio_launch_desktop,
|
2022-10-24 22:19:21 +02:00
|
|
|
'extra_programs' : ['apps', 'appinfo-test'],
|
2018-08-15 18:25:14 +02:00
|
|
|
},
|
2018-09-24 16:25:37 +02:00
|
|
|
}
|
2017-05-13 12:10:52 +02:00
|
|
|
endif
|
2017-01-28 13:52:18 +01:00
|
|
|
|
2018-09-24 16:25:37 +02:00
|
|
|
test_extra_programs += {
|
2018-08-15 18:25:14 +02:00
|
|
|
'basic-application' : {},
|
|
|
|
'dbus-launch' : {},
|
|
|
|
'appinfo-test' : {},
|
2018-09-24 16:25:37 +02:00
|
|
|
}
|
2017-01-28 13:52:18 +01:00
|
|
|
|
2017-05-13 12:10:52 +02:00
|
|
|
if not glib_have_cocoa
|
2018-09-24 16:25:37 +02:00
|
|
|
test_extra_programs += {
|
2018-08-15 18:25:14 +02:00
|
|
|
'apps' : {},
|
2018-09-24 16:25:37 +02:00
|
|
|
}
|
|
|
|
gio_tests += {
|
2018-08-15 18:25:14 +02:00
|
|
|
'mimeapps' : {},
|
2018-09-24 16:25:37 +02:00
|
|
|
}
|
2017-05-13 12:10:52 +02:00
|
|
|
endif
|
|
|
|
|
2017-01-28 13:52:18 +01:00
|
|
|
if have_dbus_daemon
|
2018-12-06 22:38:39 +01:00
|
|
|
annotate_args = [
|
|
|
|
'--annotate', 'org.project.Bar', 'Key1', 'Value1',
|
|
|
|
'--annotate', 'org.project.Bar', 'org.gtk.GDBus.Internal', 'Value2',
|
|
|
|
'--annotate', 'org.project.Bar.HelloWorld()', 'Key3', 'Value3',
|
|
|
|
'--annotate', 'org.project.Bar::TestSignal', 'Key4', 'Value4',
|
|
|
|
'--annotate', 'org.project.Bar:ay', 'Key5', 'Value5',
|
|
|
|
'--annotate', 'org.project.Bar.TestPrimitiveTypes()[val_int32]', 'Key6', 'Value6',
|
|
|
|
'--annotate', 'org.project.Bar.TestPrimitiveTypes()[ret_uint32]', 'Key7', 'Value7',
|
|
|
|
'--annotate', 'org.project.Bar::TestSignal[array_of_strings]', 'Key8', 'Value8',
|
|
|
|
]
|
2017-02-23 17:13:23 +01:00
|
|
|
# Generate gdbus-test-codegen-generated.{c,h}
|
|
|
|
gdbus_test_codegen_generated = custom_target('gdbus-test-codegen-generated',
|
|
|
|
input : ['test-codegen.xml'],
|
|
|
|
output : ['gdbus-test-codegen-generated.h',
|
|
|
|
'gdbus-test-codegen-generated.c'],
|
2022-11-24 13:09:55 +01:00
|
|
|
depend_files : gdbus_codegen_built_files,
|
2017-02-23 17:13:23 +01:00
|
|
|
command : [python, gdbus_codegen,
|
|
|
|
'--interface-prefix', 'org.project.',
|
2017-07-14 04:22:16 +02:00
|
|
|
'--output-directory', '@OUTDIR@',
|
|
|
|
'--generate-c-code', 'gdbus-test-codegen-generated',
|
2017-02-23 17:13:23 +01:00
|
|
|
'--c-generate-object-manager',
|
2018-10-26 14:49:54 +02:00
|
|
|
'--c-generate-autocleanup', 'all',
|
2017-02-23 17:13:23 +01:00
|
|
|
'--c-namespace', 'Foo_iGen',
|
|
|
|
'--generate-docbook', 'gdbus-test-codegen-generated-doc',
|
2018-12-06 22:38:39 +01:00
|
|
|
annotate_args,
|
2017-02-23 17:13:23 +01:00
|
|
|
'@INPUT@'])
|
2020-01-27 11:11:46 +01:00
|
|
|
# Generate gdbus-test-codegen-generated-min-required-2-64.{c,h}
|
|
|
|
gdbus_test_codegen_generated_min_required_2_64 = custom_target('gdbus-test-codegen-generated-min-required-2-64',
|
gdbus-codegen: Add call_flags and timeout_msec args
Currently the code generated by gdbus-codegen uses
G_DBUS_CALL_FLAGS_NONE in its D-Bus calls, which occur for each method
defined by the input XML, and for proxy_set_property functions. This
means that if the daemon which implements the methods checks for
G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION and only does interactive
authorization if that flag is present, users of the generated code have
no way to cause the daemon to use interactive authorization (e.g. polkit
dialogs).
If we simply changed the generated code to always use
G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION, its users would have no
way to disallow interactive authorization (except for manually calling
the D-Bus method themselves).
So instead, this commit adds a GDBusCallFlags argument to method call
functions. Since this is an API break which will require changes in
projects using gdbus-codegen code, the change is conditional on the
command line argument --glib-min-version having the value 2.64 or
higher.
The impetus for this change is that I'm changing accountsservice to
properly respect G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION, and
libaccountsservice uses generated code for D-Bus method calls. So
these changes will allow libaccountsservice to continue allowing
interactive authorization, and avoid breaking any users of it which
expect that. See
https://gitlab.freedesktop.org/accountsservice/accountsservice/merge_requests/46
It might make sense to also let GDBusCallFlags be specified for property
set operations, but that is not needed in the case of accountsservice,
and would require significant work and breaking API in multiple places.
Similarly, the generated code currently hard codes -1 as the timeout
value when calling g_dbus_proxy_call*(). Add a timeout_msec argument so
the user of the generated code can specify the timeout as well.
Also, test this new API. In gio/tests/codegen.py we test that the new
arguments are generated if and only of --glib-min-version is used with a
value greater than or equal to 2.64, and in gio/tests/meson.build we
test that the generated code with the new API can be linked against.
The test_unix_fd_list() test also needed modification to continue
working now that we're using gdbus-test-codegen.c with code generated
with --glib-min-version=2.64 in one test.
Finally, update the docs for gdbus-codegen to explain the effect of
using --glib-min-version 2.64, both from this commit and from
"gdbus-codegen: Emit GUnixFDLists if an arg has type `h` w/
min-version".
2019-11-25 20:51:13 +01:00
|
|
|
input : ['test-codegen.xml'],
|
2020-01-27 11:11:46 +01:00
|
|
|
output : ['gdbus-test-codegen-generated-min-required-2-64.h',
|
|
|
|
'gdbus-test-codegen-generated-min-required-2-64.c'],
|
2022-11-24 13:09:55 +01:00
|
|
|
depend_files : gdbus_codegen_built_files,
|
gdbus-codegen: Add call_flags and timeout_msec args
Currently the code generated by gdbus-codegen uses
G_DBUS_CALL_FLAGS_NONE in its D-Bus calls, which occur for each method
defined by the input XML, and for proxy_set_property functions. This
means that if the daemon which implements the methods checks for
G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION and only does interactive
authorization if that flag is present, users of the generated code have
no way to cause the daemon to use interactive authorization (e.g. polkit
dialogs).
If we simply changed the generated code to always use
G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION, its users would have no
way to disallow interactive authorization (except for manually calling
the D-Bus method themselves).
So instead, this commit adds a GDBusCallFlags argument to method call
functions. Since this is an API break which will require changes in
projects using gdbus-codegen code, the change is conditional on the
command line argument --glib-min-version having the value 2.64 or
higher.
The impetus for this change is that I'm changing accountsservice to
properly respect G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION, and
libaccountsservice uses generated code for D-Bus method calls. So
these changes will allow libaccountsservice to continue allowing
interactive authorization, and avoid breaking any users of it which
expect that. See
https://gitlab.freedesktop.org/accountsservice/accountsservice/merge_requests/46
It might make sense to also let GDBusCallFlags be specified for property
set operations, but that is not needed in the case of accountsservice,
and would require significant work and breaking API in multiple places.
Similarly, the generated code currently hard codes -1 as the timeout
value when calling g_dbus_proxy_call*(). Add a timeout_msec argument so
the user of the generated code can specify the timeout as well.
Also, test this new API. In gio/tests/codegen.py we test that the new
arguments are generated if and only of --glib-min-version is used with a
value greater than or equal to 2.64, and in gio/tests/meson.build we
test that the generated code with the new API can be linked against.
The test_unix_fd_list() test also needed modification to continue
working now that we're using gdbus-test-codegen.c with code generated
with --glib-min-version=2.64 in one test.
Finally, update the docs for gdbus-codegen to explain the effect of
using --glib-min-version 2.64, both from this commit and from
"gdbus-codegen: Emit GUnixFDLists if an arg has type `h` w/
min-version".
2019-11-25 20:51:13 +01:00
|
|
|
command : [python, gdbus_codegen,
|
2020-01-27 11:11:46 +01:00
|
|
|
'--glib-min-required', '2.64',
|
gdbus-codegen: Add call_flags and timeout_msec args
Currently the code generated by gdbus-codegen uses
G_DBUS_CALL_FLAGS_NONE in its D-Bus calls, which occur for each method
defined by the input XML, and for proxy_set_property functions. This
means that if the daemon which implements the methods checks for
G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION and only does interactive
authorization if that flag is present, users of the generated code have
no way to cause the daemon to use interactive authorization (e.g. polkit
dialogs).
If we simply changed the generated code to always use
G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION, its users would have no
way to disallow interactive authorization (except for manually calling
the D-Bus method themselves).
So instead, this commit adds a GDBusCallFlags argument to method call
functions. Since this is an API break which will require changes in
projects using gdbus-codegen code, the change is conditional on the
command line argument --glib-min-version having the value 2.64 or
higher.
The impetus for this change is that I'm changing accountsservice to
properly respect G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION, and
libaccountsservice uses generated code for D-Bus method calls. So
these changes will allow libaccountsservice to continue allowing
interactive authorization, and avoid breaking any users of it which
expect that. See
https://gitlab.freedesktop.org/accountsservice/accountsservice/merge_requests/46
It might make sense to also let GDBusCallFlags be specified for property
set operations, but that is not needed in the case of accountsservice,
and would require significant work and breaking API in multiple places.
Similarly, the generated code currently hard codes -1 as the timeout
value when calling g_dbus_proxy_call*(). Add a timeout_msec argument so
the user of the generated code can specify the timeout as well.
Also, test this new API. In gio/tests/codegen.py we test that the new
arguments are generated if and only of --glib-min-version is used with a
value greater than or equal to 2.64, and in gio/tests/meson.build we
test that the generated code with the new API can be linked against.
The test_unix_fd_list() test also needed modification to continue
working now that we're using gdbus-test-codegen.c with code generated
with --glib-min-version=2.64 in one test.
Finally, update the docs for gdbus-codegen to explain the effect of
using --glib-min-version 2.64, both from this commit and from
"gdbus-codegen: Emit GUnixFDLists if an arg has type `h` w/
min-version".
2019-11-25 20:51:13 +01:00
|
|
|
'--interface-prefix', 'org.project.',
|
|
|
|
'--output-directory', '@OUTDIR@',
|
2020-01-27 11:11:46 +01:00
|
|
|
'--generate-c-code', 'gdbus-test-codegen-generated-min-required-2-64',
|
gdbus-codegen: Add call_flags and timeout_msec args
Currently the code generated by gdbus-codegen uses
G_DBUS_CALL_FLAGS_NONE in its D-Bus calls, which occur for each method
defined by the input XML, and for proxy_set_property functions. This
means that if the daemon which implements the methods checks for
G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION and only does interactive
authorization if that flag is present, users of the generated code have
no way to cause the daemon to use interactive authorization (e.g. polkit
dialogs).
If we simply changed the generated code to always use
G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION, its users would have no
way to disallow interactive authorization (except for manually calling
the D-Bus method themselves).
So instead, this commit adds a GDBusCallFlags argument to method call
functions. Since this is an API break which will require changes in
projects using gdbus-codegen code, the change is conditional on the
command line argument --glib-min-version having the value 2.64 or
higher.
The impetus for this change is that I'm changing accountsservice to
properly respect G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION, and
libaccountsservice uses generated code for D-Bus method calls. So
these changes will allow libaccountsservice to continue allowing
interactive authorization, and avoid breaking any users of it which
expect that. See
https://gitlab.freedesktop.org/accountsservice/accountsservice/merge_requests/46
It might make sense to also let GDBusCallFlags be specified for property
set operations, but that is not needed in the case of accountsservice,
and would require significant work and breaking API in multiple places.
Similarly, the generated code currently hard codes -1 as the timeout
value when calling g_dbus_proxy_call*(). Add a timeout_msec argument so
the user of the generated code can specify the timeout as well.
Also, test this new API. In gio/tests/codegen.py we test that the new
arguments are generated if and only of --glib-min-version is used with a
value greater than or equal to 2.64, and in gio/tests/meson.build we
test that the generated code with the new API can be linked against.
The test_unix_fd_list() test also needed modification to continue
working now that we're using gdbus-test-codegen.c with code generated
with --glib-min-version=2.64 in one test.
Finally, update the docs for gdbus-codegen to explain the effect of
using --glib-min-version 2.64, both from this commit and from
"gdbus-codegen: Emit GUnixFDLists if an arg has type `h` w/
min-version".
2019-11-25 20:51:13 +01:00
|
|
|
'--c-generate-object-manager',
|
|
|
|
'--c-generate-autocleanup', 'all',
|
|
|
|
'--c-namespace', 'Foo_iGen',
|
|
|
|
'--generate-docbook', 'gdbus-test-codegen-generated-doc',
|
|
|
|
annotate_args,
|
|
|
|
'@INPUT@'])
|
2018-12-06 22:38:39 +01:00
|
|
|
gdbus_test_codegen_generated_interface_info = [
|
|
|
|
custom_target('gdbus-test-codegen-generated-interface-info-h',
|
|
|
|
input : ['test-codegen.xml'],
|
|
|
|
output : ['gdbus-test-codegen-generated-interface-info.h'],
|
2022-11-24 13:09:55 +01:00
|
|
|
depend_files : gdbus_codegen_built_files,
|
2018-12-06 22:38:39 +01:00
|
|
|
command : [python, gdbus_codegen,
|
|
|
|
'--interface-info-header',
|
|
|
|
annotate_args,
|
|
|
|
'--output', '@OUTPUT@',
|
|
|
|
'@INPUT@']),
|
|
|
|
custom_target('gdbus-test-codegen-generated-interface-info-c',
|
|
|
|
input : ['test-codegen.xml'],
|
|
|
|
output : ['gdbus-test-codegen-generated-interface-info.c'],
|
2022-11-24 13:09:55 +01:00
|
|
|
depend_files : gdbus_codegen_built_files,
|
2018-12-06 22:38:39 +01:00
|
|
|
command : [python, gdbus_codegen,
|
|
|
|
'--interface-info-body',
|
|
|
|
annotate_args,
|
|
|
|
'--output', '@OUTPUT@',
|
|
|
|
'@INPUT@']),
|
|
|
|
]
|
|
|
|
|
2018-08-15 18:25:14 +02:00
|
|
|
extra_sources = ['gdbus-sessionbus.c', 'gdbus-tests.c']
|
2022-10-25 01:59:30 +02:00
|
|
|
extra_programs = ['gdbus-testserver']
|
2018-08-15 18:25:14 +02:00
|
|
|
|
2018-09-24 16:25:37 +02:00
|
|
|
gio_tests += {
|
2018-08-15 18:25:14 +02:00
|
|
|
'actions' : {
|
|
|
|
'extra_sources' : extra_sources,
|
|
|
|
'suite' : ['slow'],
|
|
|
|
},
|
2019-04-12 18:08:22 +02:00
|
|
|
'gdbus-auth' : {'extra_sources' : extra_sources},
|
|
|
|
'gdbus-bz627724' : {'extra_sources' : extra_sources},
|
2018-08-15 18:25:14 +02:00
|
|
|
'gdbus-close-pending' : {'extra_sources' : extra_sources},
|
2022-10-25 01:59:30 +02:00
|
|
|
'gdbus-connection' : {
|
|
|
|
'extra_sources' : extra_sources,
|
|
|
|
'extra_programs': extra_programs,
|
|
|
|
},
|
|
|
|
'gdbus-connection-loss' : {
|
|
|
|
'extra_sources' : extra_sources,
|
|
|
|
'extra_programs': extra_programs,
|
|
|
|
},
|
|
|
|
'gdbus-connection-slow' : {
|
|
|
|
'extra_sources' : extra_sources,
|
2022-10-25 01:59:30 +02:00
|
|
|
'extra_programs': extra_programs + ['gdbus-connection-flush-helper'],
|
2022-10-25 01:59:30 +02:00
|
|
|
},
|
2018-08-15 18:25:14 +02:00
|
|
|
'gdbus-error' : {'extra_sources' : extra_sources},
|
|
|
|
'gdbus-exit-on-close' : {'extra_sources' : extra_sources},
|
|
|
|
'gdbus-export' : {
|
|
|
|
'extra_sources' : extra_sources,
|
|
|
|
'suite' : ['slow'],
|
|
|
|
},
|
2022-10-25 01:59:30 +02:00
|
|
|
'gdbus-introspection' : {
|
|
|
|
'extra_sources' : extra_sources,
|
|
|
|
'extra_programs': extra_programs,
|
|
|
|
},
|
2022-03-17 20:05:14 +01:00
|
|
|
'gdbus-method-invocation' : {'extra_sources' : extra_sources},
|
2022-10-25 15:51:08 +02:00
|
|
|
'gdbus-names' : {
|
|
|
|
'extra_sources' : extra_sources,
|
|
|
|
'extra_programs' : ['fake-service-name'],
|
|
|
|
},
|
2022-10-25 01:59:30 +02:00
|
|
|
'gdbus-proxy' : {
|
|
|
|
'extra_sources' : extra_sources,
|
|
|
|
'extra_programs': extra_programs,
|
|
|
|
},
|
2018-08-15 18:25:14 +02:00
|
|
|
'gdbus-proxy-threads' : {
|
|
|
|
'extra_sources' : extra_sources,
|
|
|
|
'dependencies' : [dbus1_dep],
|
|
|
|
},
|
2022-10-25 01:59:30 +02:00
|
|
|
'gdbus-proxy-unique-name' : {
|
|
|
|
'extra_sources' : extra_sources,
|
|
|
|
'extra_programs': extra_programs,
|
|
|
|
},
|
|
|
|
'gdbus-proxy-well-known-name' : {
|
|
|
|
'extra_sources' : extra_sources,
|
|
|
|
'extra_programs': extra_programs,
|
|
|
|
},
|
2018-08-15 18:25:14 +02:00
|
|
|
'gdbus-test-codegen' : {
|
2018-12-06 22:38:39 +01:00
|
|
|
'extra_sources' : [extra_sources, gdbus_test_codegen_generated, gdbus_test_codegen_generated_interface_info],
|
gdbus-codegen: Add call_flags and timeout_msec args
Currently the code generated by gdbus-codegen uses
G_DBUS_CALL_FLAGS_NONE in its D-Bus calls, which occur for each method
defined by the input XML, and for proxy_set_property functions. This
means that if the daemon which implements the methods checks for
G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION and only does interactive
authorization if that flag is present, users of the generated code have
no way to cause the daemon to use interactive authorization (e.g. polkit
dialogs).
If we simply changed the generated code to always use
G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION, its users would have no
way to disallow interactive authorization (except for manually calling
the D-Bus method themselves).
So instead, this commit adds a GDBusCallFlags argument to method call
functions. Since this is an API break which will require changes in
projects using gdbus-codegen code, the change is conditional on the
command line argument --glib-min-version having the value 2.64 or
higher.
The impetus for this change is that I'm changing accountsservice to
properly respect G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION, and
libaccountsservice uses generated code for D-Bus method calls. So
these changes will allow libaccountsservice to continue allowing
interactive authorization, and avoid breaking any users of it which
expect that. See
https://gitlab.freedesktop.org/accountsservice/accountsservice/merge_requests/46
It might make sense to also let GDBusCallFlags be specified for property
set operations, but that is not needed in the case of accountsservice,
and would require significant work and breaking API in multiple places.
Similarly, the generated code currently hard codes -1 as the timeout
value when calling g_dbus_proxy_call*(). Add a timeout_msec argument so
the user of the generated code can specify the timeout as well.
Also, test this new API. In gio/tests/codegen.py we test that the new
arguments are generated if and only of --glib-min-version is used with a
value greater than or equal to 2.64, and in gio/tests/meson.build we
test that the generated code with the new API can be linked against.
The test_unix_fd_list() test also needed modification to continue
working now that we're using gdbus-test-codegen.c with code generated
with --glib-min-version=2.64 in one test.
Finally, update the docs for gdbus-codegen to explain the effect of
using --glib-min-version 2.64, both from this commit and from
"gdbus-codegen: Emit GUnixFDLists if an arg has type `h` w/
min-version".
2019-11-25 20:51:13 +01:00
|
|
|
'c_args' : ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32'],
|
2018-08-15 18:25:14 +02:00
|
|
|
},
|
|
|
|
'gdbus-threading' : {
|
|
|
|
'extra_sources' : extra_sources,
|
2022-10-25 01:59:30 +02:00
|
|
|
'extra_programs': extra_programs,
|
2020-02-21 13:19:00 +01:00
|
|
|
'suite' : ['slow'],
|
2018-08-15 18:25:14 +02:00
|
|
|
},
|
2018-09-20 18:51:18 +02:00
|
|
|
'gmenumodel' : {
|
|
|
|
'extra_sources' : extra_sources,
|
|
|
|
'suite' : ['slow'],
|
|
|
|
},
|
2018-08-15 18:25:14 +02:00
|
|
|
'gnotification' : {
|
|
|
|
'extra_sources' : [extra_sources, 'gnotification-server.c'],
|
|
|
|
},
|
|
|
|
'gdbus-test-codegen-old' : {
|
|
|
|
'source' : 'gdbus-test-codegen.c',
|
2018-12-06 22:38:39 +01:00
|
|
|
'extra_sources' : [extra_sources, gdbus_test_codegen_generated, gdbus_test_codegen_generated_interface_info],
|
2018-08-15 18:25:14 +02:00
|
|
|
'c_args' : ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36',
|
|
|
|
'-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36'],
|
|
|
|
},
|
2020-01-27 11:11:46 +01:00
|
|
|
'gdbus-test-codegen-min-required-2-64' : {
|
gdbus-codegen: Add call_flags and timeout_msec args
Currently the code generated by gdbus-codegen uses
G_DBUS_CALL_FLAGS_NONE in its D-Bus calls, which occur for each method
defined by the input XML, and for proxy_set_property functions. This
means that if the daemon which implements the methods checks for
G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION and only does interactive
authorization if that flag is present, users of the generated code have
no way to cause the daemon to use interactive authorization (e.g. polkit
dialogs).
If we simply changed the generated code to always use
G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION, its users would have no
way to disallow interactive authorization (except for manually calling
the D-Bus method themselves).
So instead, this commit adds a GDBusCallFlags argument to method call
functions. Since this is an API break which will require changes in
projects using gdbus-codegen code, the change is conditional on the
command line argument --glib-min-version having the value 2.64 or
higher.
The impetus for this change is that I'm changing accountsservice to
properly respect G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION, and
libaccountsservice uses generated code for D-Bus method calls. So
these changes will allow libaccountsservice to continue allowing
interactive authorization, and avoid breaking any users of it which
expect that. See
https://gitlab.freedesktop.org/accountsservice/accountsservice/merge_requests/46
It might make sense to also let GDBusCallFlags be specified for property
set operations, but that is not needed in the case of accountsservice,
and would require significant work and breaking API in multiple places.
Similarly, the generated code currently hard codes -1 as the timeout
value when calling g_dbus_proxy_call*(). Add a timeout_msec argument so
the user of the generated code can specify the timeout as well.
Also, test this new API. In gio/tests/codegen.py we test that the new
arguments are generated if and only of --glib-min-version is used with a
value greater than or equal to 2.64, and in gio/tests/meson.build we
test that the generated code with the new API can be linked against.
The test_unix_fd_list() test also needed modification to continue
working now that we're using gdbus-test-codegen.c with code generated
with --glib-min-version=2.64 in one test.
Finally, update the docs for gdbus-codegen to explain the effect of
using --glib-min-version 2.64, both from this commit and from
"gdbus-codegen: Emit GUnixFDLists if an arg has type `h` w/
min-version".
2019-11-25 20:51:13 +01:00
|
|
|
'source' : 'gdbus-test-codegen.c',
|
2020-01-27 11:11:46 +01:00
|
|
|
'extra_sources' : [extra_sources, gdbus_test_codegen_generated_min_required_2_64, gdbus_test_codegen_generated_interface_info],
|
gdbus-codegen: Add call_flags and timeout_msec args
Currently the code generated by gdbus-codegen uses
G_DBUS_CALL_FLAGS_NONE in its D-Bus calls, which occur for each method
defined by the input XML, and for proxy_set_property functions. This
means that if the daemon which implements the methods checks for
G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION and only does interactive
authorization if that flag is present, users of the generated code have
no way to cause the daemon to use interactive authorization (e.g. polkit
dialogs).
If we simply changed the generated code to always use
G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION, its users would have no
way to disallow interactive authorization (except for manually calling
the D-Bus method themselves).
So instead, this commit adds a GDBusCallFlags argument to method call
functions. Since this is an API break which will require changes in
projects using gdbus-codegen code, the change is conditional on the
command line argument --glib-min-version having the value 2.64 or
higher.
The impetus for this change is that I'm changing accountsservice to
properly respect G_DBUS_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION, and
libaccountsservice uses generated code for D-Bus method calls. So
these changes will allow libaccountsservice to continue allowing
interactive authorization, and avoid breaking any users of it which
expect that. See
https://gitlab.freedesktop.org/accountsservice/accountsservice/merge_requests/46
It might make sense to also let GDBusCallFlags be specified for property
set operations, but that is not needed in the case of accountsservice,
and would require significant work and breaking API in multiple places.
Similarly, the generated code currently hard codes -1 as the timeout
value when calling g_dbus_proxy_call*(). Add a timeout_msec argument so
the user of the generated code can specify the timeout as well.
Also, test this new API. In gio/tests/codegen.py we test that the new
arguments are generated if and only of --glib-min-version is used with a
value greater than or equal to 2.64, and in gio/tests/meson.build we
test that the generated code with the new API can be linked against.
The test_unix_fd_list() test also needed modification to continue
working now that we're using gdbus-test-codegen.c with code generated
with --glib-min-version=2.64 in one test.
Finally, update the docs for gdbus-codegen to explain the effect of
using --glib-min-version 2.64, both from this commit and from
"gdbus-codegen: Emit GUnixFDLists if an arg has type `h` w/
min-version".
2019-11-25 20:51:13 +01:00
|
|
|
'c_args' : ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_64'],
|
|
|
|
},
|
2022-10-25 01:58:37 +02:00
|
|
|
'gapplication' : {
|
|
|
|
'extra_sources' : extra_sources,
|
|
|
|
'extra_programs': ['basic-application'],
|
|
|
|
},
|
2018-09-24 16:25:37 +02:00
|
|
|
}
|
2017-02-23 17:13:23 +01:00
|
|
|
|
2017-05-13 12:10:52 +02:00
|
|
|
if not glib_have_cocoa
|
2018-09-24 16:25:37 +02:00
|
|
|
gio_tests += {
|
2018-08-15 18:25:14 +02:00
|
|
|
'dbus-appinfo' : {
|
|
|
|
'extra_sources' : extra_sources,
|
2022-10-25 14:27:58 +02:00
|
|
|
'extra_programs' : ['fake-document-portal'],
|
2018-08-15 18:25:14 +02:00
|
|
|
},
|
2018-09-24 16:25:37 +02:00
|
|
|
}
|
2017-05-13 12:10:52 +02:00
|
|
|
endif
|
2019-09-16 14:04:30 +02:00
|
|
|
|
|
|
|
fake_document_portal_generated = custom_target('fake-document-portal-generated',
|
|
|
|
input : ['../org.freedesktop.portal.Documents.xml'],
|
|
|
|
output : ['fake-document-portal-generated.h',
|
|
|
|
'fake-document-portal-generated.c'],
|
2022-11-24 13:09:55 +01:00
|
|
|
depend_files : gdbus_codegen_built_files,
|
2019-09-16 14:04:30 +02:00
|
|
|
command : [python, gdbus_codegen,
|
|
|
|
'--interface-prefix', 'org.freedesktop.portal.',
|
|
|
|
'--output-directory', '@OUTDIR@',
|
|
|
|
'--generate-c-code', 'fake-document-portal-generated',
|
|
|
|
'--c-namespace', 'Fake',
|
|
|
|
'@INPUT@'])
|
|
|
|
|
|
|
|
test_extra_programs += {
|
|
|
|
'fake-document-portal' : {
|
|
|
|
'extra_sources': fake_document_portal_generated,
|
|
|
|
},
|
2021-01-16 08:03:34 +01:00
|
|
|
'fake-service-name' : {}
|
2019-09-16 14:04:30 +02:00
|
|
|
}
|
2017-02-24 10:46:36 +01:00
|
|
|
endif # have_dbus_daemon
|
|
|
|
|
|
|
|
# This test is currently unreliable
|
|
|
|
executable('gdbus-overflow', 'gdbus-overflow.c',
|
|
|
|
c_args : test_c_args,
|
2018-09-19 17:53:07 +02:00
|
|
|
dependencies : common_gio_tests_deps,
|
|
|
|
install_dir : installed_tests_execdir,
|
2022-09-20 17:00:10 +02:00
|
|
|
install_tag : 'tests',
|
2018-09-19 17:53:07 +02:00
|
|
|
install : installed_tests_enabled)
|
2017-02-24 10:46:36 +01:00
|
|
|
|
2018-09-24 16:25:37 +02:00
|
|
|
gio_tests += {
|
2018-08-15 18:25:14 +02:00
|
|
|
'gdbus-connection-flush' : {
|
|
|
|
'extra_sources' : ['test-io-stream.c', 'test-pipe-unix.c'],
|
|
|
|
},
|
|
|
|
'gdbus-non-socket' : {
|
|
|
|
'extra_sources' : ['gdbus-tests.c', 'test-io-stream.c', 'test-pipe-unix.c'],
|
|
|
|
},
|
2018-09-24 16:25:37 +02:00
|
|
|
}
|
2017-02-24 10:46:36 +01:00
|
|
|
|
|
|
|
# Generate test.mo from de.po using msgfmt
|
|
|
|
msgfmt = find_program('msgfmt', required : false)
|
|
|
|
if msgfmt.found()
|
|
|
|
subdir('de/LC_MESSAGES')
|
2018-09-24 16:25:37 +02:00
|
|
|
gio_tests += {
|
2018-08-15 18:25:14 +02:00
|
|
|
'gsettings' : {
|
|
|
|
'extra_sources' : [test_mo],
|
|
|
|
'c_args' : ['-DSRCDIR="@0@"'.format(meson.current_source_dir()),
|
|
|
|
'-DTEST_LOCALE_PATH="@0@"'.format(test_mo_dir)],
|
|
|
|
'install' : false,
|
2022-10-25 14:28:50 +02:00
|
|
|
'depends' : glib_compile_schemas,
|
2018-08-15 18:25:14 +02:00
|
|
|
},
|
2018-09-24 16:25:37 +02:00
|
|
|
}
|
2017-01-28 13:52:18 +01:00
|
|
|
endif
|
2017-02-24 10:46:36 +01:00
|
|
|
endif # unix
|
2016-03-07 12:13:24 +01:00
|
|
|
|
2017-02-23 17:13:23 +01:00
|
|
|
# Test programs buildable on Windows only
|
|
|
|
if host_machine.system() == 'windows'
|
2018-09-24 16:25:37 +02:00
|
|
|
gio_tests += {'win32-streams' : {}}
|
2017-02-23 17:13:23 +01:00
|
|
|
endif
|
|
|
|
|
2016-12-29 03:39:44 +01:00
|
|
|
if cc.get_id() != 'msvc'
|
2018-09-24 16:25:37 +02:00
|
|
|
gio_tests += {
|
2018-08-15 18:25:14 +02:00
|
|
|
'autoptr-gio' : {
|
|
|
|
'source' : 'autoptr.c',
|
|
|
|
},
|
2018-09-24 16:25:37 +02:00
|
|
|
}
|
2016-03-07 12:13:24 +01:00
|
|
|
endif
|
|
|
|
|
2018-09-24 16:25:37 +02:00
|
|
|
test_extra_programs += {
|
2018-08-15 18:25:14 +02:00
|
|
|
'gio-du' : {'install' : false},
|
|
|
|
'echo-server' : {'install' : false},
|
|
|
|
'filter-cat' : {'install' : false},
|
|
|
|
'gapplication-example-actions' : {'install' : false},
|
|
|
|
'gapplication-example-cmdline' : {'install' : false},
|
|
|
|
'gapplication-example-cmdline2' : {'install' : false},
|
|
|
|
'gapplication-example-cmdline3' : {'install' : false},
|
|
|
|
'gapplication-example-cmdline4' : {'install' : false},
|
|
|
|
'gapplication-example-dbushooks' : {'install' : false},
|
|
|
|
'gapplication-example-open' : {'install' : false},
|
|
|
|
'gdbus-daemon' : {
|
|
|
|
'extra_sources' : gdbus_daemon_sources,
|
|
|
|
'install' : false,
|
|
|
|
},
|
|
|
|
'gdbus-example-export' : {'install' : false},
|
|
|
|
'gdbus-example-own-name' : {'install' : false},
|
|
|
|
'gdbus-example-peer' : {'install' : false},
|
|
|
|
'gdbus-example-proxy-subclass' : {'install' : false},
|
|
|
|
'gdbus-example-server' : {'install' : false},
|
|
|
|
'gdbus-example-subtree' : {'install' : false},
|
|
|
|
'gdbus-example-watch-name' : {'install' : false},
|
|
|
|
'gdbus-example-watch-proxy' : {'install' : false},
|
|
|
|
'httpd' : {'install' : false},
|
|
|
|
'proxy' : {'install' : false},
|
|
|
|
'resolver' : {'install' : false},
|
|
|
|
'send-data' : {'install' : false},
|
|
|
|
'socket-server' : {'install' : false},
|
|
|
|
'socket-client' : {
|
|
|
|
'extra_sources' : ['gtlsconsoleinteraction.c'],
|
|
|
|
'install' : false,
|
|
|
|
},
|
2018-09-24 16:25:37 +02:00
|
|
|
}
|
2016-03-07 12:13:24 +01:00
|
|
|
|
2019-07-09 20:57:54 +02:00
|
|
|
gdbus_example_objectmanager_sources = files(
|
|
|
|
'gdbus-example-objectmanager-client.c',
|
|
|
|
'gdbus-example-objectmanager-server.c',
|
|
|
|
)
|
|
|
|
|
2019-07-09 18:22:51 +02:00
|
|
|
if cc.get_id() != 'msvc' and cc.get_id() != 'clang-cl'
|
2018-09-24 16:25:37 +02:00
|
|
|
test_extra_programs += {
|
2018-09-09 14:46:33 +02:00
|
|
|
# These three are manual-run tests because they need a session bus but don't bring one up themselves
|
|
|
|
# FIXME: these build but don't seem to work!
|
|
|
|
'gdbus-example-objectmanager-client' : {
|
|
|
|
'dependencies' : [libgdbus_example_objectmanager_dep],
|
|
|
|
'install' : false,
|
|
|
|
},
|
|
|
|
'gdbus-example-objectmanager-server' : {
|
|
|
|
'dependencies' : [libgdbus_example_objectmanager_dep],
|
|
|
|
'install' : false,
|
|
|
|
},
|
|
|
|
'gdbus-test-fixture' : {
|
|
|
|
'dependencies' : [libgdbus_example_objectmanager_dep],
|
|
|
|
'install' : false,
|
|
|
|
},
|
2018-09-24 16:25:37 +02:00
|
|
|
}
|
2018-09-09 14:46:33 +02:00
|
|
|
endif
|
|
|
|
|
2017-01-28 13:52:18 +01:00
|
|
|
if host_machine.system() != 'windows'
|
2018-09-24 16:25:37 +02:00
|
|
|
test_extra_programs += {
|
2018-08-15 18:25:14 +02:00
|
|
|
'gdbus-example-unix-fd-client' : {
|
|
|
|
'install' : false,
|
|
|
|
},
|
2018-09-24 16:25:37 +02:00
|
|
|
}
|
2017-01-28 13:52:18 +01:00
|
|
|
endif
|
|
|
|
|
2018-11-30 18:20:48 +01:00
|
|
|
appinfo_test_desktop_files = [
|
2022-10-28 18:29:22 +02:00
|
|
|
'appinfo-test-gnome',
|
|
|
|
'appinfo-test-notgnome',
|
|
|
|
'appinfo-test',
|
|
|
|
'appinfo-test2',
|
2018-11-30 18:20:48 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
foreach appinfo_test_desktop_file : appinfo_test_desktop_files
|
2022-10-28 18:29:22 +02:00
|
|
|
input_desktop_file = appinfo_test_desktop_file + '.desktop.in'
|
|
|
|
output_desktop_file = appinfo_test_desktop_file + '.desktop'
|
|
|
|
configure_file(
|
|
|
|
input: input_desktop_file,
|
|
|
|
output: output_desktop_file,
|
|
|
|
configuration: {
|
|
|
|
'installed_tests_dir' : meson.current_build_dir(),
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2019-06-17 17:52:36 +02:00
|
|
|
if installed_tests_enabled
|
2022-10-28 18:29:22 +02:00
|
|
|
installed_desktop = configure_file(
|
|
|
|
input: input_desktop_file,
|
|
|
|
output: appinfo_test_desktop_file + '-installed.desktop',
|
|
|
|
configuration: {
|
|
|
|
'installed_tests_dir' : installed_tests_execdir,
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
install_data(installed_desktop,
|
2019-06-17 17:52:36 +02:00
|
|
|
install_dir: installed_tests_execdir,
|
2022-09-20 17:00:10 +02:00
|
|
|
install_tag: 'tests',
|
2022-10-28 18:29:22 +02:00
|
|
|
rename: output_desktop_file,
|
2019-06-17 17:52:36 +02:00
|
|
|
)
|
|
|
|
endif
|
2018-11-30 18:20:48 +01:00
|
|
|
endforeach
|
|
|
|
|
2018-09-19 17:53:07 +02:00
|
|
|
if installed_tests_enabled
|
|
|
|
install_data(
|
|
|
|
'contexts.c',
|
|
|
|
'g-icon.c',
|
|
|
|
'appinfo-test-actions.desktop',
|
2018-12-14 14:05:17 +01:00
|
|
|
'appinfo-test-static.desktop',
|
2018-09-19 17:53:07 +02:00
|
|
|
'file.c',
|
|
|
|
'org.gtk.test.dbusappinfo.desktop',
|
2019-09-16 16:30:10 +02:00
|
|
|
'org.gtk.test.dbusappinfo.flatpak.desktop',
|
2019-02-11 11:21:13 +01:00
|
|
|
'test1.overlay',
|
2018-09-19 17:53:07 +02:00
|
|
|
install_dir : installed_tests_execdir,
|
2022-09-20 17:00:10 +02:00
|
|
|
install_tag : 'tests',
|
|
|
|
)
|
|
|
|
install_subdir('x-content',
|
|
|
|
install_dir : installed_tests_execdir,
|
|
|
|
install_tag : 'tests',
|
|
|
|
)
|
|
|
|
install_subdir('desktop-files',
|
|
|
|
install_dir : installed_tests_execdir,
|
|
|
|
install_tag : 'tests',
|
|
|
|
)
|
|
|
|
install_subdir('thumbnails',
|
|
|
|
install_dir : installed_tests_execdir,
|
|
|
|
install_tag : 'tests',
|
|
|
|
)
|
|
|
|
install_subdir('cert-tests',
|
|
|
|
install_dir : installed_tests_execdir,
|
|
|
|
install_tag : 'tests',
|
2018-09-19 17:53:07 +02:00
|
|
|
)
|
2018-09-26 16:56:10 +02:00
|
|
|
|
|
|
|
cdata = configuration_data()
|
|
|
|
cdata.set('installed_tests_dir', installed_tests_execdir)
|
|
|
|
cdata.set('program', 'static-link.py ' + glib_pkgconfigreldir)
|
|
|
|
configure_file(
|
|
|
|
input: installed_tests_template,
|
|
|
|
output: 'static-link.test',
|
|
|
|
install_dir: installed_tests_metadir,
|
2022-09-20 17:00:10 +02:00
|
|
|
install_tag: 'tests',
|
2018-09-26 16:56:10 +02:00
|
|
|
configuration: cdata
|
|
|
|
)
|
2022-09-20 17:00:10 +02:00
|
|
|
install_subdir('static-link',
|
|
|
|
install_dir : installed_tests_execdir,
|
|
|
|
install_tag : 'tests',
|
|
|
|
)
|
|
|
|
install_data('static-link.py',
|
|
|
|
install_dir : installed_tests_execdir,
|
|
|
|
install_tag : 'tests',
|
|
|
|
)
|
2018-09-19 17:53:07 +02:00
|
|
|
|
2021-08-10 10:58:53 +02:00
|
|
|
monitor_tests = [
|
2020-02-27 21:13:19 +01:00
|
|
|
'memory-monitor-dbus',
|
|
|
|
'memory-monitor-portal',
|
2021-08-10 10:58:53 +02:00
|
|
|
'power-profile-monitor-dbus',
|
|
|
|
'power-profile-monitor-portal'
|
2020-02-27 21:13:19 +01:00
|
|
|
]
|
2019-11-15 12:24:57 +01:00
|
|
|
|
2021-08-10 10:58:53 +02:00
|
|
|
foreach monitor_test : monitor_tests
|
2020-02-27 21:13:19 +01:00
|
|
|
cdata = configuration_data()
|
|
|
|
cdata.set('installed_tests_dir', installed_tests_execdir)
|
2021-08-10 10:58:53 +02:00
|
|
|
cdata.set('program', monitor_test + '.py')
|
2020-04-07 16:45:06 +02:00
|
|
|
cdata.set('env', '')
|
2020-02-27 21:13:19 +01:00
|
|
|
configure_file(
|
2020-04-07 16:45:06 +02:00
|
|
|
input: installed_tests_template_tap,
|
2021-08-10 10:58:53 +02:00
|
|
|
output: monitor_test + '.test',
|
2020-02-27 21:13:19 +01:00
|
|
|
install_dir: installed_tests_metadir,
|
2022-09-20 17:00:10 +02:00
|
|
|
install_tag: 'tests',
|
2020-02-27 21:13:19 +01:00
|
|
|
configuration: cdata
|
|
|
|
)
|
|
|
|
cdata = configuration_data()
|
|
|
|
cdata.set('libexecdir', join_paths(glib_prefix, get_option('libexecdir')))
|
|
|
|
configure_file(
|
2021-08-10 10:58:53 +02:00
|
|
|
input: monitor_test + '.py.in',
|
|
|
|
output: monitor_test + '.py',
|
2020-02-27 21:13:19 +01:00
|
|
|
install_dir : installed_tests_execdir,
|
2022-09-20 17:00:10 +02:00
|
|
|
install_tag : 'tests',
|
2020-02-27 21:13:19 +01:00
|
|
|
configuration: cdata,
|
|
|
|
)
|
|
|
|
endforeach
|
|
|
|
endif
|
2019-11-15 12:24:57 +01:00
|
|
|
|
2022-11-14 14:01:47 +01:00
|
|
|
# FIXME: Work around Meson not automatically using exe_wrapper around glib_compile_resources
|
|
|
|
# https://github.com/mesonbuild/meson/issues/11029
|
|
|
|
if not meson.is_cross_build()
|
2017-02-23 01:40:45 +01:00
|
|
|
|
2022-10-25 16:16:44 +02:00
|
|
|
resource_plugin = []
|
2021-09-18 14:59:01 +02:00
|
|
|
compiler_type = '--compiler=@0@'.format(cc.get_id())
|
|
|
|
|
2022-10-20 00:51:34 +02:00
|
|
|
if glib_build_shared
|
2022-08-23 15:13:44 +02:00
|
|
|
plugin_resources_c = custom_target('plugin-resources.c',
|
|
|
|
input : 'test4.gresource.xml',
|
|
|
|
output : 'plugin-resources.c',
|
|
|
|
command : [glib_compile_resources,
|
|
|
|
compiler_type,
|
|
|
|
'--target=@OUTPUT@',
|
|
|
|
'--sourcedir=' + meson.current_source_dir(),
|
|
|
|
'--internal',
|
|
|
|
'--generate-source',
|
|
|
|
'--c-name', '_g_plugin',
|
|
|
|
'@INPUT@'])
|
2017-02-23 01:40:45 +01:00
|
|
|
|
2022-10-25 16:16:44 +02:00
|
|
|
resource_plugin += shared_module('resourceplugin',
|
|
|
|
sources: ['resourceplugin.c', plugin_resources_c],
|
2022-08-23 15:13:44 +02:00
|
|
|
link_args : export_dynamic_ldflags,
|
|
|
|
dependencies : common_gio_tests_deps,
|
|
|
|
install_dir : installed_tests_execdir,
|
|
|
|
install_tag : 'tests',
|
|
|
|
install : installed_tests_enabled
|
|
|
|
)
|
|
|
|
endif
|
2017-02-23 01:40:45 +01:00
|
|
|
|
2018-11-30 10:49:44 +01:00
|
|
|
# referenced by test2.gresource.xml
|
|
|
|
big_test_resource = custom_target(
|
|
|
|
'gresource-big-test.txt',
|
|
|
|
input : ['gen-big-test-resource.py'],
|
|
|
|
output : ['gresource-big-test.txt'],
|
|
|
|
command : [python, '@INPUT0@', '@OUTPUT@'])
|
|
|
|
|
2017-02-23 01:40:45 +01:00
|
|
|
test_gresource = custom_target('test.gresource',
|
|
|
|
input : 'test.gresource.xml',
|
|
|
|
output : 'test.gresource',
|
|
|
|
command : [glib_compile_resources,
|
2021-09-18 14:59:01 +02:00
|
|
|
compiler_type,
|
2017-02-23 01:40:45 +01:00
|
|
|
'--target=@OUTPUT@',
|
|
|
|
'--sourcedir=' + meson.current_source_dir(),
|
|
|
|
'--sourcedir=' + meson.current_build_dir(),
|
2022-01-26 15:27:38 +01:00
|
|
|
'--internal',
|
2018-09-19 17:53:07 +02:00
|
|
|
'@INPUT@'],
|
|
|
|
install_dir : installed_tests_execdir,
|
2022-09-20 17:00:10 +02:00
|
|
|
install_tag : 'tests',
|
2018-09-19 17:53:07 +02:00
|
|
|
install : installed_tests_enabled)
|
2017-02-23 01:40:45 +01:00
|
|
|
|
|
|
|
test_resources2_c = custom_target('test_resources2.c',
|
|
|
|
input : 'test3.gresource.xml',
|
|
|
|
output : 'test_resources2.c',
|
|
|
|
command : [glib_compile_resources,
|
2021-09-18 14:59:01 +02:00
|
|
|
compiler_type,
|
2017-02-23 01:40:45 +01:00
|
|
|
'--target=@OUTPUT@',
|
|
|
|
'--sourcedir=' + meson.current_source_dir(),
|
2022-01-26 15:27:38 +01:00
|
|
|
'--internal',
|
2017-02-23 01:40:45 +01:00
|
|
|
'--generate',
|
|
|
|
'--c-name', '_g_test2',
|
|
|
|
'--manual-register',
|
|
|
|
'@INPUT@'])
|
|
|
|
|
|
|
|
test_resources2_h = custom_target('test_resources2.h',
|
|
|
|
input : 'test3.gresource.xml',
|
|
|
|
output : 'test_resources2.h',
|
|
|
|
command : [glib_compile_resources,
|
2021-09-18 14:59:01 +02:00
|
|
|
compiler_type,
|
2017-02-23 01:40:45 +01:00
|
|
|
'--target=@OUTPUT@',
|
|
|
|
'--sourcedir=' + meson.current_source_dir(),
|
2022-01-26 15:27:38 +01:00
|
|
|
'--internal',
|
2017-02-23 01:40:45 +01:00
|
|
|
'--generate',
|
|
|
|
'--c-name', '_g_test2',
|
|
|
|
'--manual-register',
|
|
|
|
'@INPUT@'])
|
|
|
|
|
|
|
|
test_resources_c = custom_target('test_resources.c',
|
|
|
|
input : 'test2.gresource.xml',
|
2018-11-30 10:49:44 +01:00
|
|
|
depends : big_test_resource,
|
2017-02-23 01:40:45 +01:00
|
|
|
output : 'test_resources.c',
|
|
|
|
command : [glib_compile_resources,
|
2021-09-18 14:59:01 +02:00
|
|
|
compiler_type,
|
2017-02-23 01:40:45 +01:00
|
|
|
'--target=@OUTPUT@',
|
|
|
|
'--sourcedir=' + meson.current_source_dir(),
|
2018-11-30 10:49:44 +01:00
|
|
|
'--sourcedir=' + meson.current_build_dir(),
|
2022-01-26 15:27:38 +01:00
|
|
|
'--internal',
|
2017-02-23 01:40:45 +01:00
|
|
|
'--generate-source',
|
|
|
|
'--c-name', '_g_test1',
|
|
|
|
'@INPUT@'])
|
|
|
|
|
2019-02-20 11:38:29 +01:00
|
|
|
digit_test_resources_c = custom_target('digit_test_resources.c',
|
|
|
|
input : '111_digit_test.gresource.xml',
|
|
|
|
output : 'digit_test_resources.c',
|
|
|
|
command : [glib_compile_resources,
|
2021-09-18 14:59:01 +02:00
|
|
|
compiler_type,
|
2019-02-20 11:38:29 +01:00
|
|
|
'--target=@OUTPUT@',
|
|
|
|
'--sourcedir=' + meson.current_source_dir(),
|
|
|
|
'--sourcedir=' + meson.current_build_dir(),
|
2022-01-26 15:27:38 +01:00
|
|
|
'--internal',
|
2019-02-20 11:38:29 +01:00
|
|
|
'--generate-source',
|
|
|
|
'--manual-register',
|
|
|
|
'@INPUT@'])
|
|
|
|
|
|
|
|
digit_test_resources_h = custom_target('digit_test_resources.h',
|
|
|
|
input : '111_digit_test.gresource.xml',
|
|
|
|
output : 'digit_test_resources.h',
|
|
|
|
command : [glib_compile_resources,
|
2021-09-18 14:59:01 +02:00
|
|
|
compiler_type,
|
2019-02-20 11:38:29 +01:00
|
|
|
'--target=@OUTPUT@',
|
|
|
|
'--sourcedir=' + meson.current_source_dir(),
|
2022-01-26 15:27:38 +01:00
|
|
|
'--internal',
|
2019-02-20 11:38:29 +01:00
|
|
|
'--generate',
|
|
|
|
'--manual-register',
|
|
|
|
'@INPUT@'])
|
|
|
|
|
2022-11-24 13:09:55 +01:00
|
|
|
# referenced by test.gresource.xml
|
|
|
|
test_generated_txt = configure_file(input : 'test1.txt',
|
|
|
|
output : 'test-generated.txt',
|
|
|
|
copy : true,
|
|
|
|
)
|
|
|
|
|
2019-04-03 17:45:58 +02:00
|
|
|
resources_extra_sources = [
|
|
|
|
test_gresource,
|
|
|
|
test_resources_c,
|
|
|
|
test_resources2_c,
|
|
|
|
test_resources2_h,
|
|
|
|
digit_test_resources_c,
|
|
|
|
digit_test_resources_h,
|
|
|
|
]
|
|
|
|
|
2019-04-12 15:13:58 +02:00
|
|
|
# Create object file containing resource data for testing the --external-data
|
2021-06-14 15:48:14 +02:00
|
|
|
# option. Currently only GNU ld and objcopy, or (as of 2019) LLVM ld and
|
|
|
|
# objcopy, support the right options.
|
2019-11-20 21:32:33 +01:00
|
|
|
objcopy_supports_add_symbol = false
|
2019-10-28 13:08:48 +01:00
|
|
|
objcopy = find_program('objcopy', required : false)
|
2019-11-20 21:32:33 +01:00
|
|
|
if objcopy.found()
|
2021-11-24 13:01:39 +01:00
|
|
|
# FIXME: This should be `check: true` because we never really expect
|
|
|
|
# `objcopy --help` to fail, given that `objcopy` exists. However, it does
|
|
|
|
# fail on FreeBSD because ELF Tool Chain has
|
|
|
|
# [a bug](https://sourceforge.net/p/elftoolchain/code/3950/).
|
|
|
|
# This can be changed back to `check: true` once our CI uses a FreeBSD
|
|
|
|
# version which includes the fix.
|
|
|
|
# See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2360#note_1318608
|
|
|
|
objcopy_supports_add_symbol = run_command(objcopy, '--help', check: false).stdout().contains('--add-symbol')
|
2019-11-20 21:32:33 +01:00
|
|
|
endif
|
|
|
|
|
2019-11-04 11:24:15 +01:00
|
|
|
ld = find_program('ld', required : false)
|
2019-10-28 13:08:48 +01:00
|
|
|
|
2021-06-14 15:48:14 +02:00
|
|
|
if build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found()
|
2018-09-09 18:31:38 +02:00
|
|
|
test_gresource_binary = custom_target('test5.gresource',
|
|
|
|
input : 'test5.gresource.xml',
|
|
|
|
output : 'test5.gresource',
|
|
|
|
command : [glib_compile_resources,
|
2021-09-18 14:59:01 +02:00
|
|
|
compiler_type,
|
2018-09-09 18:31:38 +02:00
|
|
|
'--target=@OUTPUT@',
|
|
|
|
'--sourcedir=' + meson.current_source_dir(),
|
|
|
|
'--sourcedir=' + meson.current_build_dir(),
|
2022-01-26 15:27:38 +01:00
|
|
|
'--internal',
|
2018-09-09 18:31:38 +02:00
|
|
|
'@INPUT@'],
|
|
|
|
install_dir : installed_tests_execdir,
|
2022-09-20 17:00:10 +02:00
|
|
|
install_tag : 'tests',
|
2018-09-09 18:31:38 +02:00
|
|
|
install : installed_tests_enabled)
|
|
|
|
|
2019-04-03 17:45:05 +02:00
|
|
|
# Create resource data file
|
2018-09-09 18:31:38 +02:00
|
|
|
test_resources_binary_c = custom_target('test_resources_binary.c',
|
|
|
|
input : 'test5.gresource.xml',
|
|
|
|
output : 'test_resources_binary.c',
|
|
|
|
command : [glib_compile_resources,
|
2021-09-18 14:59:01 +02:00
|
|
|
compiler_type,
|
2018-09-09 18:31:38 +02:00
|
|
|
'--target=@OUTPUT@',
|
|
|
|
'--sourcedir=' + meson.current_source_dir(),
|
|
|
|
'--sourcedir=' + meson.current_build_dir(),
|
2022-01-26 15:27:38 +01:00
|
|
|
'--internal',
|
2018-09-09 18:31:38 +02:00
|
|
|
'--generate-source',
|
|
|
|
'--external-data',
|
|
|
|
'--c-name', '_g_binary_test1',
|
|
|
|
'@INPUT@'])
|
|
|
|
|
2019-04-03 17:45:05 +02:00
|
|
|
# Create object file containing resource data
|
2018-09-09 18:31:38 +02:00
|
|
|
test_resources_binary = custom_target('test_resources.o',
|
|
|
|
input : test_gresource_binary,
|
|
|
|
output : 'test_resources.o',
|
2019-11-04 11:24:15 +01:00
|
|
|
command : [ld,
|
2022-01-26 15:28:46 +01:00
|
|
|
'-z', 'noexecstack',
|
2018-09-09 18:31:38 +02:00
|
|
|
'-r',
|
|
|
|
'-b','binary',
|
|
|
|
'@INPUT@',
|
|
|
|
'-o','@OUTPUT@'])
|
|
|
|
|
2019-04-03 17:45:05 +02:00
|
|
|
# Rename symbol to match the one in the C file
|
2022-01-06 09:18:37 +01:00
|
|
|
if cc.get_id() == 'gcc' and host_system == 'windows'
|
|
|
|
underscore = '_'
|
|
|
|
else
|
|
|
|
underscore = ''
|
|
|
|
endif
|
2018-09-09 18:31:38 +02:00
|
|
|
test_resources_binary2 = custom_target('test_resources2.o',
|
|
|
|
input : test_resources_binary,
|
|
|
|
output : 'test_resources2.o',
|
2019-10-28 13:08:48 +01:00
|
|
|
command : [objcopy,
|
2022-01-26 15:28:46 +01:00
|
|
|
'--strip-all',
|
2022-01-06 09:18:37 +01:00
|
|
|
'--add-symbol', underscore + '_g_binary_test1_resource_data=.data:0',
|
2018-09-09 18:31:38 +02:00
|
|
|
'@INPUT@',
|
|
|
|
'@OUTPUT@'])
|
|
|
|
|
2019-04-03 17:45:58 +02:00
|
|
|
resources_extra_sources += [
|
|
|
|
test_resources_binary_c,
|
|
|
|
test_resources_binary2,
|
|
|
|
]
|
2018-09-09 18:31:38 +02:00
|
|
|
endif
|
2019-04-03 17:45:58 +02:00
|
|
|
|
|
|
|
gio_tests += {
|
|
|
|
'resources' : {
|
|
|
|
'extra_sources' : resources_extra_sources,
|
2022-10-25 16:16:44 +02:00
|
|
|
'depends' : resource_plugin,
|
2019-04-03 17:45:58 +02:00
|
|
|
},
|
|
|
|
}
|
2017-02-23 01:40:45 +01:00
|
|
|
endif
|
2016-12-21 03:16:30 +01:00
|
|
|
|
2022-10-24 22:16:29 +02:00
|
|
|
test_extra_programs_targets = {}
|
|
|
|
foreach program_name, extra_args : test_extra_programs
|
|
|
|
source = extra_args.get('source', program_name + '.c')
|
|
|
|
extra_sources = extra_args.get('extra_sources', [])
|
|
|
|
install = installed_tests_enabled and extra_args.get('install', true)
|
|
|
|
test_extra_programs_targets += {
|
|
|
|
program_name : executable(program_name,
|
|
|
|
sources: [source, extra_sources],
|
|
|
|
c_args : test_c_args,
|
|
|
|
dependencies : common_gio_tests_deps + extra_args.get('dependencies', []),
|
|
|
|
install_dir : installed_tests_execdir,
|
|
|
|
install_tag : 'tests',
|
|
|
|
install : install,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
endforeach
|
|
|
|
|
2018-09-24 16:25:37 +02:00
|
|
|
foreach test_name, extra_args : gio_tests
|
|
|
|
source = extra_args.get('source', test_name + '.c')
|
|
|
|
extra_sources = extra_args.get('extra_sources', [])
|
|
|
|
install = installed_tests_enabled and extra_args.get('install', true)
|
2019-02-12 12:29:10 +01:00
|
|
|
installed_tests_env = extra_args.get('installed_tests_env', {})
|
2018-09-24 16:25:37 +02:00
|
|
|
|
|
|
|
if install
|
|
|
|
test_conf = configuration_data()
|
|
|
|
test_conf.set('installed_tests_dir', installed_tests_execdir)
|
|
|
|
test_conf.set('program', test_name)
|
2019-02-12 12:29:10 +01:00
|
|
|
test_env_override = ''
|
|
|
|
if installed_tests_env != {}
|
|
|
|
envs = []
|
|
|
|
foreach var, value : installed_tests_env
|
|
|
|
envs += '@0@=@1@'.format(var, value)
|
|
|
|
endforeach
|
2022-05-06 14:16:26 +02:00
|
|
|
test_env_override = '@0@ @1@ '.format(env_program.full_path(), ' '.join(envs))
|
2019-02-12 12:29:10 +01:00
|
|
|
endif
|
|
|
|
test_conf.set('env', test_env_override)
|
2018-09-24 16:25:37 +02:00
|
|
|
configure_file(
|
|
|
|
input: installed_tests_template_tap,
|
|
|
|
output: test_name + '.test',
|
|
|
|
install_dir: installed_tests_metadir,
|
2022-09-20 17:00:10 +02:00
|
|
|
install_tag: 'tests',
|
2018-09-24 16:25:37 +02:00
|
|
|
configuration: test_conf
|
2018-08-15 18:25:14 +02:00
|
|
|
)
|
2018-09-24 16:25:37 +02:00
|
|
|
endif
|
2018-08-15 18:25:14 +02:00
|
|
|
|
2018-09-24 16:25:37 +02:00
|
|
|
exe = executable(test_name, [source, extra_sources],
|
|
|
|
c_args : test_c_args + extra_args.get('c_args', []),
|
2022-09-13 18:26:40 +02:00
|
|
|
cpp_args : test_cpp_args + extra_args.get('cpp_args', []),
|
2018-09-24 16:25:37 +02:00
|
|
|
dependencies : common_gio_tests_deps + extra_args.get('dependencies', []),
|
2018-09-24 19:32:08 +02:00
|
|
|
install_rpath : extra_args.get('install_rpath', ''),
|
2018-09-24 16:25:37 +02:00
|
|
|
install_dir: installed_tests_execdir,
|
2022-09-20 17:00:10 +02:00
|
|
|
install_tag: 'tests',
|
2018-09-24 16:25:37 +02:00
|
|
|
install: install,
|
|
|
|
)
|
|
|
|
|
|
|
|
suite = ['gio'] + extra_args.get('suite', [])
|
2018-11-01 10:35:17 +01:00
|
|
|
timeout = suite.contains('slow') ? test_timeout_slow : test_timeout
|
2018-11-16 19:54:07 +01:00
|
|
|
local_test_env = test_env
|
2022-10-24 22:16:29 +02:00
|
|
|
depends = [extra_args.get('depends', [])]
|
|
|
|
|
|
|
|
foreach program : extra_args.get('extra_programs', [])
|
|
|
|
depends += test_extra_programs_targets[program]
|
|
|
|
endforeach
|
2018-11-16 19:54:07 +01:00
|
|
|
|
|
|
|
foreach var, value : extra_args.get('env', {})
|
|
|
|
local_test_env.append(var, value)
|
|
|
|
endforeach
|
|
|
|
|
2022-10-19 20:08:15 +02:00
|
|
|
if extra_args.get('can_fail', false)
|
|
|
|
suite += 'failing'
|
|
|
|
endif
|
|
|
|
|
2018-09-24 16:25:37 +02:00
|
|
|
test(test_name, exe,
|
2018-11-16 19:54:07 +01:00
|
|
|
env : local_test_env,
|
2018-09-24 16:25:37 +02:00
|
|
|
timeout : timeout,
|
|
|
|
suite : suite,
|
|
|
|
is_parallel : extra_args.get('is_parallel', true),
|
2022-10-24 22:16:29 +02:00
|
|
|
depends : depends,
|
2022-02-18 00:01:35 +01:00
|
|
|
should_fail : extra_args.get('should_fail', false),
|
2018-09-24 16:25:37 +02:00
|
|
|
)
|
2018-08-15 18:25:14 +02:00
|
|
|
endforeach
|
|
|
|
|
2022-10-19 20:08:15 +02:00
|
|
|
foreach test_name, extra_args : python_tests
|
2022-10-24 22:16:29 +02:00
|
|
|
depends = [extra_args.get('depends', [])]
|
2022-10-19 20:08:15 +02:00
|
|
|
suite = ['gio', 'no-valgrind']
|
|
|
|
|
|
|
|
if extra_args.get('can_fail', false)
|
|
|
|
suite += 'failing'
|
|
|
|
endif
|
|
|
|
|
2022-10-24 22:16:29 +02:00
|
|
|
foreach program : extra_args.get('extra_programs', [])
|
|
|
|
depends += test_extra_programs_targets[program]
|
|
|
|
endforeach
|
|
|
|
|
2019-12-02 15:05:22 +01:00
|
|
|
test(
|
|
|
|
test_name,
|
|
|
|
python,
|
2022-10-24 22:16:29 +02:00
|
|
|
depends: depends,
|
2019-12-02 15:05:22 +01:00
|
|
|
args: ['-B', files(test_name)],
|
|
|
|
env: test_env,
|
2022-10-19 20:08:15 +02:00
|
|
|
suite: suite,
|
2019-12-02 15:05:22 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
if installed_tests_enabled
|
|
|
|
install_data(
|
|
|
|
files(test_name),
|
|
|
|
install_dir: installed_tests_execdir,
|
2022-09-20 17:00:10 +02:00
|
|
|
install_tag: 'tests',
|
2019-12-02 15:05:22 +01:00
|
|
|
install_mode: 'rwxr-xr-x',
|
|
|
|
)
|
|
|
|
|
|
|
|
test_conf = configuration_data()
|
|
|
|
test_conf.set('installed_tests_dir', installed_tests_execdir)
|
|
|
|
test_conf.set('program', test_name)
|
|
|
|
test_conf.set('env', '')
|
|
|
|
configure_file(
|
|
|
|
input: installed_tests_template_tap,
|
|
|
|
output: test_name + '.test',
|
|
|
|
install_dir: installed_tests_metadir,
|
2022-09-20 17:00:10 +02:00
|
|
|
install_tag: 'tests',
|
2019-12-02 15:05:22 +01:00
|
|
|
configuration: test_conf,
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
# TAP test runner for Python tests
|
|
|
|
if installed_tests_enabled
|
|
|
|
install_data(
|
|
|
|
files('taptestrunner.py'),
|
|
|
|
install_dir: installed_tests_execdir,
|
2022-09-20 17:00:10 +02:00
|
|
|
install_tag: 'tests',
|
2019-12-02 15:05:22 +01:00
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2019-09-16 14:04:30 +02:00
|
|
|
subdir('services')
|