mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 15:56:23 +01:00
Merge branch '1444-install-tests' into 'master'
Resolve "the meson build doesn't support installed tests" Closes #1444 See merge request GNOME/glib!245
This commit is contained in:
commit
9a3c7eca14
@ -15,69 +15,67 @@ giotypefuncs_inc = custom_target(
|
|||||||
command: [gengiotypefuncs_prog, '@OUTPUT@', '@INPUT@'])
|
command: [gengiotypefuncs_prog, '@OUTPUT@', '@INPUT@'])
|
||||||
|
|
||||||
# Test programs buildable on all platforms
|
# Test programs buildable on all platforms
|
||||||
gio_tests = [
|
# FIXME: We are using list of dictionnaries until we can depend on Meson 0.48.0
|
||||||
'appmonitor',
|
# that supports '+=' operator on dictionnaries.
|
||||||
'async-close-output-stream',
|
gio_tests = [{
|
||||||
'async-splice-output-stream',
|
'appmonitor' : {},
|
||||||
'buffered-input-stream',
|
'async-close-output-stream' : {},
|
||||||
'buffered-output-stream',
|
'async-splice-output-stream' : {},
|
||||||
'cancellable',
|
'buffered-input-stream' : {},
|
||||||
'contexts',
|
'buffered-output-stream' : {},
|
||||||
'contenttype',
|
'cancellable' : {},
|
||||||
'converter-stream',
|
'contexts' : {},
|
||||||
'credentials',
|
'contenttype' : {},
|
||||||
'data-input-stream',
|
'converter-stream' : {},
|
||||||
'data-output-stream',
|
'credentials' : {},
|
||||||
'defaultvalue',
|
'data-input-stream' : {},
|
||||||
'fileattributematcher',
|
'data-output-stream' : {},
|
||||||
'filter-streams',
|
'defaultvalue' : {'extra_sources' : [giotypefuncs_inc]},
|
||||||
'giomodule',
|
'fileattributematcher' : {},
|
||||||
'gsubprocess',
|
'filter-streams' : {},
|
||||||
'g-file',
|
'giomodule' : {},
|
||||||
'g-file-info',
|
'gsubprocess' : {},
|
||||||
'g-icon',
|
'g-file' : {},
|
||||||
'gdbus-addresses',
|
'g-file-info' : {},
|
||||||
'gdbus-message',
|
'g-icon' : {},
|
||||||
'inet-address',
|
'gdbus-addresses' : {},
|
||||||
'io-stream',
|
'gdbus-message' : {},
|
||||||
'memory-input-stream',
|
'inet-address' : {},
|
||||||
'memory-output-stream',
|
'io-stream' : {},
|
||||||
'monitor',
|
'memory-input-stream' : {},
|
||||||
'mount-operation',
|
'memory-output-stream' : {},
|
||||||
'network-address',
|
'monitor' : {},
|
||||||
'network-monitor',
|
'mount-operation' : {},
|
||||||
'network-monitor-race',
|
'network-address' : {},
|
||||||
'permission',
|
'network-monitor' : {},
|
||||||
'pollable',
|
'network-monitor-race' : {},
|
||||||
'proxy-test',
|
'permission' : {},
|
||||||
'readwrite',
|
'pollable' : {},
|
||||||
'simple-async-result',
|
'proxy-test' : {},
|
||||||
'simple-proxy',
|
'readwrite' : {},
|
||||||
'sleepy-stream',
|
'simple-async-result' : {},
|
||||||
'socket',
|
'simple-proxy' : {},
|
||||||
'socket-listener',
|
'sleepy-stream' : {},
|
||||||
'socket-service',
|
'socket' : {},
|
||||||
'srvtarget',
|
'socket-listener' : {},
|
||||||
'task',
|
'socket-service' : {},
|
||||||
'vfs',
|
'srvtarget' : {},
|
||||||
'volumemonitor',
|
'task' : {},
|
||||||
'glistmodel',
|
'vfs' : {},
|
||||||
'testfilemonitor',
|
'volumemonitor' : {},
|
||||||
'thumbnail-verification',
|
'glistmodel' : {},
|
||||||
'tls-certificate',
|
'testfilemonitor' : {'suite' : ['slow']},
|
||||||
'tls-interaction',
|
'thumbnail-verification' : {},
|
||||||
]
|
'tls-certificate' : {'extra_sources' : ['gtesttlsbackend.c']},
|
||||||
slow_tests = [
|
'tls-interaction' : {'extra_sources' : ['gtesttlsbackend.c']},
|
||||||
'actions',
|
}]
|
||||||
'gdbus-export',
|
|
||||||
'gdbus-threading',
|
|
||||||
'testfilemonitor',
|
|
||||||
]
|
|
||||||
|
|
||||||
test_extra_programs = [
|
# FIXME: We are using list of dictionnaries until we can depend on Meson 0.48.0
|
||||||
['gdbus-connection-flush-helper'],
|
# that supports '+=' operator on dictionnaries.
|
||||||
['gdbus-testserver'],
|
test_extra_programs = [{
|
||||||
]
|
'gdbus-connection-flush-helper' : {},
|
||||||
|
'gdbus-testserver' : {},
|
||||||
|
}]
|
||||||
|
|
||||||
test_env = environment()
|
test_env = environment()
|
||||||
test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
|
test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
|
||||||
@ -110,49 +108,57 @@ endif
|
|||||||
if dbus1_dep.found()
|
if dbus1_dep.found()
|
||||||
glib_conf.set('HAVE_DBUS1', 1)
|
glib_conf.set('HAVE_DBUS1', 1)
|
||||||
|
|
||||||
exe = executable('gdbus-serialization',
|
gio_tests += [{
|
||||||
'gdbus-serialization.c', 'gdbus-tests.c',
|
'gdbus-serialization' : {
|
||||||
install : false,
|
'extra_sources' : ['gdbus-tests.c'],
|
||||||
c_args : test_c_args,
|
'dependencies' : [dbus1_dep],
|
||||||
dependencies : common_gio_tests_deps + [dbus1_dep])
|
}
|
||||||
test('gdbus-serialization', exe, env : test_env, suite : ['gio'])
|
}]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Test programs buildable on UNIX only
|
# Test programs buildable on UNIX only
|
||||||
if host_machine.system() != 'windows'
|
if host_machine.system() != 'windows'
|
||||||
gio_tests += [
|
gio_tests += [{
|
||||||
'file',
|
'file' : {},
|
||||||
'gdbus-peer',
|
'gdbus-peer' : {'dependencies' : [libgdbus_example_objectmanager_dep]},
|
||||||
'gdbus-peer-object-manager',
|
'gdbus-peer-object-manager' : {},
|
||||||
'live-g-file',
|
'live-g-file' : {},
|
||||||
'socket-address',
|
'socket-address' : {},
|
||||||
'stream-rw_all',
|
'stream-rw_all' : {},
|
||||||
'unix-fd',
|
'unix-fd' : {},
|
||||||
'unix-mounts',
|
'unix-mounts' : {},
|
||||||
'unix-streams',
|
'unix-streams' : {},
|
||||||
'g-file-info-filesystem-readonly',
|
'g-file-info-filesystem-readonly' : {},
|
||||||
'gschema-compile',
|
'gschema-compile' : {'install' : false},
|
||||||
'trash',
|
'trash' : {},
|
||||||
]
|
}]
|
||||||
|
|
||||||
# Uninstalled because of the check-for-executable logic in DesktopAppInfo
|
# Uninstalled because of the check-for-executable logic in DesktopAppInfo
|
||||||
# unable to find the installed executable
|
# unable to find the installed executable
|
||||||
if not glib_have_cocoa
|
if not glib_have_cocoa
|
||||||
gio_tests += [
|
gio_tests += [{
|
||||||
'appinfo',
|
'appinfo' : {
|
||||||
'desktop-app-info',
|
'install' : false,
|
||||||
]
|
},
|
||||||
|
'desktop-app-info' : {
|
||||||
|
'install' : false,
|
||||||
|
},
|
||||||
|
}]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
test_extra_programs += [
|
test_extra_programs += [{
|
||||||
['basic-application'],
|
'basic-application' : {},
|
||||||
['dbus-launch'],
|
'dbus-launch' : {},
|
||||||
['appinfo-test'],
|
'appinfo-test' : {},
|
||||||
]
|
}]
|
||||||
|
|
||||||
if not glib_have_cocoa
|
if not glib_have_cocoa
|
||||||
test_extra_programs += [['apps']]
|
test_extra_programs += [{
|
||||||
gio_tests += ['mimeapps']
|
'apps' : {},
|
||||||
|
}]
|
||||||
|
gio_tests += [{
|
||||||
|
'mimeapps' : {},
|
||||||
|
}]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Test programs that need to bring up a session bus (requires dbus-daemon)
|
# Test programs that need to bring up a session bus (requires dbus-daemon)
|
||||||
@ -181,71 +187,61 @@ if host_machine.system() != 'windows'
|
|||||||
'--annotate', 'org.project.Bar::TestSignal[array_of_strings]', 'Key8', 'Value8',
|
'--annotate', 'org.project.Bar::TestSignal[array_of_strings]', 'Key8', 'Value8',
|
||||||
'@INPUT@'])
|
'@INPUT@'])
|
||||||
|
|
||||||
gio_dbus_tests = [
|
extra_sources = ['gdbus-sessionbus.c', 'gdbus-tests.c']
|
||||||
['actions', [], []],
|
|
||||||
['gdbus-auth', [], []],
|
gio_tests += [{
|
||||||
['gdbus-bz627724', [], []],
|
'actions' : {
|
||||||
['gdbus-close-pending', [], []],
|
'extra_sources' : extra_sources,
|
||||||
['gdbus-connection', [], []],
|
'suite' : ['slow'],
|
||||||
['gdbus-connection-loss', [], []],
|
},
|
||||||
['gdbus-connection-slow', [], []],
|
'gdbus-auth' : {'extra_sources' : extra_sources},
|
||||||
['gdbus-error', [], []],
|
'gdbus-bz627724' : {'extra_sources' : extra_sources},
|
||||||
['gdbus-exit-on-close', [], []],
|
'gdbus-close-pending' : {'extra_sources' : extra_sources},
|
||||||
['gdbus-export', [], []],
|
'gdbus-connection' : {'extra_sources' : extra_sources},
|
||||||
['gdbus-introspection', [], []],
|
'gdbus-connection-loss' : {'extra_sources' : extra_sources},
|
||||||
['gdbus-names', [], []],
|
'gdbus-connection-slow' : {'extra_sources' : extra_sources},
|
||||||
['gdbus-proxy', [], []],
|
'gdbus-error' : {'extra_sources' : extra_sources},
|
||||||
['gdbus-proxy-threads', [], [dbus1_dep]],
|
'gdbus-exit-on-close' : {'extra_sources' : extra_sources},
|
||||||
['gdbus-proxy-well-known-name', [], []],
|
'gdbus-export' : {
|
||||||
['gdbus-test-codegen', [gdbus_test_codegen_generated], []],
|
'extra_sources' : extra_sources,
|
||||||
['gdbus-threading', [], []],
|
'suite' : ['slow'],
|
||||||
['gmenumodel', [], []],
|
},
|
||||||
['gnotification', ['gnotification-server.c'], []],
|
'gdbus-introspection' : {'extra_sources' : extra_sources},
|
||||||
]
|
'gdbus-names' : {'extra_sources' : extra_sources},
|
||||||
|
'gdbus-proxy' : {'extra_sources' : extra_sources},
|
||||||
|
'gdbus-proxy-threads' : {
|
||||||
|
'extra_sources' : extra_sources,
|
||||||
|
'dependencies' : [dbus1_dep],
|
||||||
|
},
|
||||||
|
'gdbus-proxy-well-known-name' : {'extra_sources' : extra_sources},
|
||||||
|
'gdbus-test-codegen' : {
|
||||||
|
'extra_sources' : [extra_sources, gdbus_test_codegen_generated],
|
||||||
|
},
|
||||||
|
'gdbus-threading' : {
|
||||||
|
'extra_sources' : extra_sources,
|
||||||
|
'suite' : ['slow'],
|
||||||
|
},
|
||||||
|
'gmenumodel' : {'extra_sources' : extra_sources},
|
||||||
|
'gnotification' : {
|
||||||
|
'extra_sources' : [extra_sources, 'gnotification-server.c'],
|
||||||
|
},
|
||||||
|
'gdbus-test-codegen-old' : {
|
||||||
|
'source' : 'gdbus-test-codegen.c',
|
||||||
|
'extra_sources' : [extra_sources, gdbus_test_codegen_generated],
|
||||||
|
'c_args' : ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36',
|
||||||
|
'-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36'],
|
||||||
|
},
|
||||||
|
'gapplication' : {'extra_sources' : extra_sources},
|
||||||
|
'gdbus-unix-addresses' : {},
|
||||||
|
}]
|
||||||
|
|
||||||
if not glib_have_cocoa
|
if not glib_have_cocoa
|
||||||
gio_dbus_tests += [['dbus-appinfo', [], []]]
|
gio_tests += [{
|
||||||
|
'dbus-appinfo' : {
|
||||||
|
'extra_sources' : extra_sources,
|
||||||
|
},
|
||||||
|
}]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# separate loop because extra source files for each test
|
|
||||||
foreach dbus_test : gio_dbus_tests
|
|
||||||
test_name = dbus_test[0]
|
|
||||||
extra_src = dbus_test[1]
|
|
||||||
extra_deps = dbus_test[2]
|
|
||||||
exe = executable(test_name, '@0@.c'.format(test_name),
|
|
||||||
'gdbus-sessionbus.c', 'gdbus-tests.c', extra_src,
|
|
||||||
install : false,
|
|
||||||
c_args : test_c_args,
|
|
||||||
dependencies : common_gio_tests_deps + extra_deps)
|
|
||||||
# These tests may take more than 30 seconds to run on the CI infrastructure
|
|
||||||
if slow_tests.contains(test_name)
|
|
||||||
test(test_name, exe, env : test_env, timeout : 120, suite : ['gio', 'slow'])
|
|
||||||
else
|
|
||||||
test(test_name, exe, env : test_env, suite : ['gio'])
|
|
||||||
endif
|
|
||||||
endforeach
|
|
||||||
|
|
||||||
exe = executable('gdbus-test-codegen-old', 'gdbus-test-codegen.c',
|
|
||||||
'gdbus-sessionbus.c', 'gdbus-tests.c', gdbus_test_codegen_generated,
|
|
||||||
install : false,
|
|
||||||
c_args : test_c_args + ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36', '-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36'],
|
|
||||||
dependencies : common_gio_tests_deps)
|
|
||||||
test('gdbus-test-codegen-old', exe, env : test_env, suite : ['gio'])
|
|
||||||
|
|
||||||
# There is already a gapplication exe target in gio so need to use a
|
|
||||||
# different name for the unit test executable, since we can't have two
|
|
||||||
# targets of the same name even if in different directories
|
|
||||||
# (FIXME: just rename source file to gapplication-test.c)
|
|
||||||
if not glib_have_cocoa
|
|
||||||
exe = executable('gapplication-test', 'gapplication.c',
|
|
||||||
'gdbus-sessionbus.c', 'gdbus-tests.c',
|
|
||||||
install : false,
|
|
||||||
c_args : test_c_args,
|
|
||||||
dependencies : common_gio_tests_deps)
|
|
||||||
endif
|
|
||||||
test('gapplication', exe, env : test_env, suite : ['gio'])
|
|
||||||
|
|
||||||
gio_tests += ['gdbus-unix-addresses']
|
|
||||||
endif # have_dbus_daemon
|
endif # have_dbus_daemon
|
||||||
|
|
||||||
# This test is currently unreliable
|
# This test is currently unreliable
|
||||||
@ -254,125 +250,100 @@ if host_machine.system() != 'windows'
|
|||||||
c_args : test_c_args,
|
c_args : test_c_args,
|
||||||
dependencies : common_gio_tests_deps)
|
dependencies : common_gio_tests_deps)
|
||||||
|
|
||||||
exe = executable('gdbus-connection-flush', 'gdbus-connection-flush.c',
|
gio_tests += [{
|
||||||
'test-io-stream.c', 'test-pipe-unix.c',
|
'gdbus-connection-flush' : {
|
||||||
install : false,
|
'extra_sources' : ['test-io-stream.c', 'test-pipe-unix.c'],
|
||||||
c_args : test_c_args,
|
},
|
||||||
dependencies : common_gio_tests_deps)
|
'gdbus-non-socket' : {
|
||||||
test('gdbus-connection-flush', exe, env : test_env, suite : ['gio'])
|
'extra_sources' : ['gdbus-tests.c', 'test-io-stream.c', 'test-pipe-unix.c'],
|
||||||
|
},
|
||||||
exe = executable('gdbus-non-socket', 'gdbus-non-socket.c',
|
}]
|
||||||
'gdbus-tests.c', 'test-io-stream.c', 'test-pipe-unix.c',
|
|
||||||
install : false,
|
|
||||||
c_args : test_c_args,
|
|
||||||
dependencies : common_gio_tests_deps)
|
|
||||||
test('gdbus-non-socket', exe, env : test_env, suite : ['gio'])
|
|
||||||
|
|
||||||
# Generate test.mo from de.po using msgfmt
|
# Generate test.mo from de.po using msgfmt
|
||||||
msgfmt = find_program('msgfmt', required : false)
|
msgfmt = find_program('msgfmt', required : false)
|
||||||
if msgfmt.found()
|
if msgfmt.found()
|
||||||
subdir('de/LC_MESSAGES')
|
subdir('de/LC_MESSAGES')
|
||||||
# gsettings target exe already exists in gio directory
|
gio_tests += [{
|
||||||
exe = executable('gsettings-test', 'gsettings.c', test_mo,
|
'gsettings' : {
|
||||||
install : false,
|
'extra_sources' : [test_mo],
|
||||||
c_args : test_c_args + [
|
'c_args' : ['-DSRCDIR="@0@"'.format(meson.current_source_dir()),
|
||||||
'-DSRCDIR="@0@"'.format(meson.current_source_dir()),
|
'-DTEST_LOCALE_PATH="@0@"'.format(test_mo_dir)],
|
||||||
'-DTEST_LOCALE_PATH="@0@"'.format(test_mo_dir),
|
'install' : false,
|
||||||
],
|
},
|
||||||
dependencies : common_gio_tests_deps)
|
}]
|
||||||
test('gsettings', exe, env : test_env, suite : ['gio'])
|
|
||||||
endif
|
endif
|
||||||
endif # unix
|
endif # unix
|
||||||
|
|
||||||
# Test programs buildable on Windows only
|
# Test programs buildable on Windows only
|
||||||
if host_machine.system() == 'windows'
|
if host_machine.system() == 'windows'
|
||||||
gio_tests += ['win32-streams']
|
gio_tests += [{'win32-streams' : {}}]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if cc.get_id() != 'msvc'
|
if cc.get_id() != 'msvc'
|
||||||
gio_tests += [ 'autoptr' ]
|
gio_tests += [{
|
||||||
|
'autoptr-gio' : {
|
||||||
|
'source' : 'autoptr.c',
|
||||||
|
},
|
||||||
|
}]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
foreach test_name : gio_tests
|
test_extra_programs += [{
|
||||||
extra_deps = []
|
'gio-du' : {'install' : false},
|
||||||
srcs = ['@0@.c'.format(test_name)]
|
'echo-server' : {'install' : false},
|
||||||
# conflicts with glib/tests/autoptr, can't have two targets with same name
|
'filter-cat' : {'install' : false},
|
||||||
if test_name == 'autoptr'
|
'gapplication-example-actions' : {'install' : false},
|
||||||
test_name = 'autoptr-gio'
|
'gapplication-example-cmdline' : {'install' : false},
|
||||||
elif test_name == 'defaultvalue'
|
'gapplication-example-cmdline2' : {'install' : false},
|
||||||
srcs += [giotypefuncs_inc]
|
'gapplication-example-cmdline3' : {'install' : false},
|
||||||
elif test_name == 'gdbus-peer'
|
'gapplication-example-cmdline4' : {'install' : false},
|
||||||
# This is peer to peer so it doesn't need a session bus, so we can run
|
'gapplication-example-dbushooks' : {'install' : false},
|
||||||
# it automatically as a test by default
|
'gapplication-example-open' : {'install' : false},
|
||||||
extra_deps = [libgdbus_example_objectmanager_dep]
|
'gdbus-daemon' : {
|
||||||
elif test_name == 'tls-certificate' or test_name == 'tls-interaction'
|
'extra_sources' : gdbus_daemon_sources,
|
||||||
srcs += ['gtesttlsbackend.c']
|
'install' : false,
|
||||||
endif
|
},
|
||||||
exe = executable(test_name, srcs,
|
'gdbus-example-export' : {'install' : false},
|
||||||
install : false,
|
'gdbus-example-own-name' : {'install' : false},
|
||||||
c_args : test_c_args,
|
'gdbus-example-peer' : {'install' : false},
|
||||||
dependencies : common_gio_tests_deps + extra_deps)
|
'gdbus-example-proxy-subclass' : {'install' : false},
|
||||||
# These tests may take more than 30 seconds to run on the CI infrastructure
|
'gdbus-example-server' : {'install' : false},
|
||||||
if slow_tests.contains(test_name)
|
'gdbus-example-subtree' : {'install' : false},
|
||||||
test(test_name, exe, env : test_env, timeout : 120, suite : ['gio', 'slow'])
|
'gdbus-example-watch-name' : {'install' : false},
|
||||||
else
|
'gdbus-example-watch-proxy' : {'install' : false},
|
||||||
test(test_name, exe, env : test_env, suite : ['gio'])
|
'gsubprocess-testprog' : {'install' : false},
|
||||||
endif
|
'httpd' : {'install' : false},
|
||||||
endforeach
|
'proxy' : {'install' : false},
|
||||||
|
'resolver' : {'install' : false},
|
||||||
uninstalled_test_extra_programs = [
|
'send-data' : {'install' : false},
|
||||||
['gio-du'],
|
'socket-server' : {'install' : false},
|
||||||
['echo-server'],
|
'socket-client' : {
|
||||||
['filter-cat'],
|
'extra_sources' : ['gtlsconsoleinteraction.c'],
|
||||||
['gapplication-example-actions'],
|
'install' : false,
|
||||||
['gapplication-example-cmdline'],
|
},
|
||||||
['gapplication-example-cmdline2'],
|
|
||||||
['gapplication-example-cmdline3'],
|
|
||||||
['gapplication-example-cmdline4'],
|
|
||||||
['gapplication-example-dbushooks'],
|
|
||||||
['gapplication-example-open'],
|
|
||||||
['gdbus-daemon', gdbus_daemon_sources],
|
|
||||||
['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'],
|
|
||||||
['socket-client', ['gtlsconsoleinteraction.c']],
|
|
||||||
# These three are manual-run tests because they need a session bus but don't bring one up themselves
|
# 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!
|
# FIXME: these build but don't seem to work!
|
||||||
['gdbus-example-objectmanager-client', [], [libgdbus_example_objectmanager_dep]],
|
'gdbus-example-objectmanager-client' : {
|
||||||
['gdbus-example-objectmanager-server', [], [libgdbus_example_objectmanager_dep]],
|
'dependencies' : [libgdbus_example_objectmanager_dep],
|
||||||
['gdbus-test-fixture', [], [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,
|
||||||
|
},
|
||||||
|
}]
|
||||||
|
|
||||||
if host_machine.system() != 'windows'
|
if host_machine.system() != 'windows'
|
||||||
uninstalled_test_extra_programs += [['gdbus-example-unix-fd-client']]
|
test_extra_programs += [{
|
||||||
|
'gdbus-example-unix-fd-client' : {
|
||||||
|
'install' : false,
|
||||||
|
},
|
||||||
|
}]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
foreach extra_program : uninstalled_test_extra_programs + test_extra_programs
|
|
||||||
srcs = ['@0@.c'.format(extra_program[0])]
|
|
||||||
if extra_program.length() > 1
|
|
||||||
srcs += extra_program[1]
|
|
||||||
endif
|
|
||||||
extra_deps = []
|
|
||||||
if extra_program.length() > 2
|
|
||||||
extra_deps = extra_program[2]
|
|
||||||
endif
|
|
||||||
executable(extra_program[0], srcs,
|
|
||||||
install : false,
|
|
||||||
c_args : test_c_args,
|
|
||||||
dependencies : common_gio_tests_deps + extra_deps)
|
|
||||||
endforeach
|
|
||||||
|
|
||||||
if not meson.is_cross_build() or meson.has_exe_wrapper()
|
if not meson.is_cross_build() or meson.has_exe_wrapper()
|
||||||
|
|
||||||
plugin_resources_c = custom_target('plugin-resources.c',
|
plugin_resources_c = custom_target('plugin-resources.c',
|
||||||
@ -441,13 +412,58 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
|
|||||||
copy : true,
|
copy : true,
|
||||||
install : false)
|
install : false)
|
||||||
|
|
||||||
exe = executable('resources', 'resources.c', test_gresource,
|
gio_tests += [{
|
||||||
test_resources_c, test_resources2_c, test_resources2_h,
|
'resources' : {
|
||||||
install : false,
|
'extra_sources' : [test_gresource, test_resources_c, test_resources2_c,
|
||||||
c_args : test_c_args,
|
test_resources2_h],
|
||||||
dependencies : common_gio_tests_deps)
|
},
|
||||||
test('resources', exe, env : test_env, suite : ['gio'])
|
}]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
foreach test_dict : gio_tests
|
||||||
|
foreach test_name, extra_args : test_dict
|
||||||
|
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)
|
||||||
|
|
||||||
|
if install
|
||||||
|
test_conf = configuration_data()
|
||||||
|
test_conf.set('installed_tests_dir', installed_tests_execdir)
|
||||||
|
test_conf.set('program', test_name)
|
||||||
|
configure_file(
|
||||||
|
input: installed_tests_template,
|
||||||
|
output: test_name + '.test',
|
||||||
|
install_dir: installed_tests_metadir,
|
||||||
|
configuration: test_conf
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
||||||
|
exe = executable(test_name, [source, extra_sources],
|
||||||
|
c_args : test_c_args + extra_args.get('c_args', []),
|
||||||
|
dependencies : common_gio_tests_deps + extra_args.get('dependencies', []),
|
||||||
|
install_dir: installed_tests_execdir,
|
||||||
|
install: install,
|
||||||
|
)
|
||||||
|
|
||||||
|
suite = ['gio'] + extra_args.get('suite', [])
|
||||||
|
timeout = suite.contains('slow') ? 120 : 30
|
||||||
|
test(test_name, exe, env : test_env, timeout : timeout, suite : suite)
|
||||||
|
endforeach
|
||||||
|
endforeach
|
||||||
|
|
||||||
|
foreach program_dict : test_extra_programs
|
||||||
|
foreach program_name, extra_args : program_dict
|
||||||
|
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)
|
||||||
|
executable(program_name, [source, extra_sources],
|
||||||
|
c_args : test_c_args,
|
||||||
|
dependencies : common_gio_tests_deps + extra_args.get('dependencies', []),
|
||||||
|
install_dir : installed_tests_execdir,
|
||||||
|
install : install,
|
||||||
|
)
|
||||||
|
endforeach
|
||||||
|
endforeach
|
||||||
|
|
||||||
# FIXME: subdir('services')
|
# FIXME: subdir('services')
|
||||||
subdir('modules')
|
subdir('modules')
|
||||||
|
@ -1,47 +1,3 @@
|
|||||||
gobject_tests = [
|
|
||||||
'qdata',
|
|
||||||
'boxed',
|
|
||||||
'enums',
|
|
||||||
'param',
|
|
||||||
'threadtests',
|
|
||||||
'dynamictests',
|
|
||||||
'binding',
|
|
||||||
'properties',
|
|
||||||
'reference',
|
|
||||||
'value',
|
|
||||||
'type',
|
|
||||||
'private',
|
|
||||||
'closure',
|
|
||||||
'object',
|
|
||||||
'signal-handler',
|
|
||||||
'ifaceproperties',
|
|
||||||
]
|
|
||||||
|
|
||||||
# FIXME: put common bits of test environment() in one location
|
|
||||||
# Not entirely random of course, but at least it changes over time
|
|
||||||
random_number = minor_version + meson.version().split('.').get(1).to_int()
|
|
||||||
|
|
||||||
test_env = environment()
|
|
||||||
test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
|
|
||||||
test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
|
|
||||||
test_env.set('G_DEBUG', 'gc-friendly')
|
|
||||||
test_env.set('MALLOC_CHECK_', '2')
|
|
||||||
test_env.set('MALLOC_PERTURB_', '@0@'.format(random_number % 256))
|
|
||||||
|
|
||||||
foreach test_name : gobject_tests
|
|
||||||
deps = [libm, thread_dep, libglib_dep, libgobject_dep]
|
|
||||||
test_src = '@0@.c'.format(test_name)
|
|
||||||
# private is an existing or reserved target it seems
|
|
||||||
if test_name == 'private'
|
|
||||||
test_name = 'gobject-private'
|
|
||||||
endif
|
|
||||||
exe = executable(test_name, test_src,
|
|
||||||
c_args : ['-DG_LOG_DOMAIN="GLib-GObject"'],
|
|
||||||
dependencies : deps,
|
|
||||||
)
|
|
||||||
test(test_name, exe, env : test_env, suite : ['gobject'])
|
|
||||||
endforeach
|
|
||||||
|
|
||||||
marshalers_h = custom_target('marshalers_h',
|
marshalers_h = custom_target('marshalers_h',
|
||||||
output : 'marshalers.h',
|
output : 'marshalers.h',
|
||||||
input : 'marshalers.list',
|
input : 'marshalers.list',
|
||||||
@ -70,12 +26,71 @@ marshalers_c = custom_target('marshalers_c',
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
exe = executable('signals',
|
gobject_tests = {
|
||||||
'signals.c', marshalers_h, marshalers_c,
|
'qdata' : {},
|
||||||
c_args : ['-DG_LOG_DOMAIN="GLib-GObject"'],
|
'boxed' : {},
|
||||||
dependencies : deps,
|
'enums' : {},
|
||||||
)
|
'param' : {},
|
||||||
test('signals', exe, env : test_env, suite : ['gobject'])
|
'threadtests' : {},
|
||||||
|
'dynamictests' : {},
|
||||||
|
'binding' : {},
|
||||||
|
'properties' : {},
|
||||||
|
'reference' : {},
|
||||||
|
'value' : {},
|
||||||
|
'type' : {},
|
||||||
|
'gobject-private' : {
|
||||||
|
'source' : 'private.c',
|
||||||
|
},
|
||||||
|
'closure' : {},
|
||||||
|
'object' : {},
|
||||||
|
'signal-handler' : {},
|
||||||
|
'ifaceproperties' : {},
|
||||||
|
'signals' : {
|
||||||
|
'source' : ['signals.c', marshalers_h, marshalers_c],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
# FIXME: put common bits of test environment() in one location
|
||||||
|
# Not entirely random of course, but at least it changes over time
|
||||||
|
random_number = minor_version + meson.version().split('.').get(1).to_int()
|
||||||
|
|
||||||
|
test_env = environment()
|
||||||
|
test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
|
||||||
|
test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
|
||||||
|
test_env.set('G_DEBUG', 'gc-friendly')
|
||||||
|
test_env.set('MALLOC_CHECK_', '2')
|
||||||
|
test_env.set('MALLOC_PERTURB_', '@0@'.format(random_number % 256))
|
||||||
|
|
||||||
|
test_deps = [libm, thread_dep, libglib_dep, libgobject_dep]
|
||||||
|
test_cargs = ['-DG_LOG_DOMAIN="GLib-GObject"']
|
||||||
|
|
||||||
|
foreach test_name, extra_args : gobject_tests
|
||||||
|
source = extra_args.get('source', test_name + '.c')
|
||||||
|
install = installed_tests_enabled and extra_args.get('install', true)
|
||||||
|
|
||||||
|
if install
|
||||||
|
test_conf = configuration_data()
|
||||||
|
test_conf.set('installed_tests_dir', installed_tests_execdir)
|
||||||
|
test_conf.set('program', test_name)
|
||||||
|
configure_file(
|
||||||
|
input: installed_tests_template,
|
||||||
|
output: test_name + '.test',
|
||||||
|
install_dir: installed_tests_metadir,
|
||||||
|
configuration: test_conf
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
||||||
|
exe = executable(test_name, source,
|
||||||
|
c_args : test_cargs + extra_args.get('c_args', []),
|
||||||
|
dependencies : test_deps + extra_args.get('dependencies', []),
|
||||||
|
install_dir: installed_tests_execdir,
|
||||||
|
install: install,
|
||||||
|
)
|
||||||
|
|
||||||
|
suite = ['gobject'] + extra_args.get('suite', [])
|
||||||
|
timeout = suite.contains('slow') ? 120 : 30
|
||||||
|
test(test_name, exe, env : test_env, timeout : timeout, suite : suite)
|
||||||
|
endforeach
|
||||||
|
|
||||||
test(
|
test(
|
||||||
'mkenums.py',
|
'mkenums.py',
|
||||||
|
Loading…
Reference in New Issue
Block a user