mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-01-08 04:40:15 +01:00
test: add missing test dependencies
This fixes doing "meson setup" followed by "meson test", without doing a full build in between. Signed-off-by: Alyssa Ross <hi@alyssa.is>
This commit is contained in:
parent
3d8b06a421
commit
55e60abe18
2 changed files with 59 additions and 35 deletions
|
|
@ -190,6 +190,20 @@ test_shell_service = executable('test-shell-service',
|
||||||
link_with: libdbus_testutils,
|
link_with: libdbus_testutils,
|
||||||
dependencies: dbus_dependencies,
|
dependencies: dbus_dependencies,
|
||||||
)
|
)
|
||||||
|
test_sleep_forever = executable('test-sleep-forever',
|
||||||
|
'test-sleep-forever.c',
|
||||||
|
link_with: libdbus_testutils,
|
||||||
|
include_directories: root_include,
|
||||||
|
install: install_tests,
|
||||||
|
install_dir: test_exec_dir
|
||||||
|
)
|
||||||
|
test_service = executable('test-service',
|
||||||
|
'test-service.c',
|
||||||
|
link_with: libdbus_testutils,
|
||||||
|
include_directories: root_include,
|
||||||
|
install: install_tests,
|
||||||
|
install_dir: test_exec_dir
|
||||||
|
)
|
||||||
|
|
||||||
if use_traditional_activation
|
if use_traditional_activation
|
||||||
test_spawn = executable('test-spawn',
|
test_spawn = executable('test-spawn',
|
||||||
|
|
@ -321,6 +335,12 @@ if embedded_tests
|
||||||
'srcs': [ 'bus/helper-activation.c', 'bus/common.c' ],
|
'srcs': [ 'bus/helper-activation.c', 'bus/common.c' ],
|
||||||
'link': [ libdbus_testutils, libdbus_daemon_internal, ],
|
'link': [ libdbus_testutils, libdbus_daemon_internal, ],
|
||||||
'install': false,
|
'install': false,
|
||||||
|
'test_deps': [
|
||||||
|
launch_helper_for_tests,
|
||||||
|
test_segfault,
|
||||||
|
test_service,
|
||||||
|
test_shell_service,
|
||||||
|
],
|
||||||
'suite': ['slow'],
|
'suite': ['slow'],
|
||||||
'timeout': 1000,
|
'timeout': 1000,
|
||||||
},
|
},
|
||||||
|
|
@ -341,28 +361,12 @@ if embedded_tests
|
||||||
'srcs': [ 'internals/spawn-oom.c', ],
|
'srcs': [ 'internals/spawn-oom.c', ],
|
||||||
'link': [ libdbus_testutils, ],
|
'link': [ libdbus_testutils, ],
|
||||||
'install': false,
|
'install': false,
|
||||||
|
'test_deps': [ test_exit, test_segfault ],
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
tests += [
|
|
||||||
{
|
|
||||||
'name': 'test-service',
|
|
||||||
'srcs': [ 'test-service.c' ],
|
|
||||||
'link': [ libdbus_testutils, ],
|
|
||||||
'install': true,
|
|
||||||
'test': false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name': 'test-sleep-forever',
|
|
||||||
'srcs': [ 'test-sleep-forever.c' ],
|
|
||||||
'link': [ libdbus_testutils, ],
|
|
||||||
'install': true,
|
|
||||||
'test': false,
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
tests += [
|
tests += [
|
||||||
{
|
{
|
||||||
'name': 'atomic',
|
'name': 'atomic',
|
||||||
|
|
@ -542,6 +546,7 @@ if use_glib
|
||||||
'srcs': [ 'internals/sysdeps.c' ],
|
'srcs': [ 'internals/sysdeps.c' ],
|
||||||
'link': [ libdbus_testutils, ],
|
'link': [ libdbus_testutils, ],
|
||||||
'deps': [ glib, gio, ],
|
'deps': [ glib, gio, ],
|
||||||
|
'test_deps': [ test_sleep_forever ],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'syslog',
|
'name': 'syslog',
|
||||||
|
|
@ -608,11 +613,15 @@ foreach test: tests
|
||||||
srcs = test.get('srcs')
|
srcs = test.get('srcs')
|
||||||
link = test.get('link', [])
|
link = test.get('link', [])
|
||||||
deps = test.get('deps', [])
|
deps = test.get('deps', [])
|
||||||
|
test_deps = test.get('test_deps', [])
|
||||||
suites = test.get('suite', ['dbus'])
|
suites = test.get('suite', ['dbus'])
|
||||||
install = test.get('install', true)
|
install = test.get('install', true)
|
||||||
|
|
||||||
if suites.contains('runs-dbus-daemon') and not (message_bus and tools)
|
if suites.contains('runs-dbus-daemon')
|
||||||
continue
|
if not (message_bus and tools)
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
test_deps += dbus_daemon
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if test.get('test', true)
|
if test.get('test', true)
|
||||||
|
|
@ -645,6 +654,7 @@ foreach test: tests
|
||||||
test(name,
|
test(name,
|
||||||
test_exe,
|
test_exe,
|
||||||
args: ['--tap'],
|
args: ['--tap'],
|
||||||
|
depends: test_deps,
|
||||||
env: test_env,
|
env: test_env,
|
||||||
protocol: test_protocol,
|
protocol: test_protocol,
|
||||||
suite: suites,
|
suite: suites,
|
||||||
|
|
@ -668,7 +678,8 @@ scripts = []
|
||||||
|
|
||||||
if message_bus and tools and platform_unix and use_glib
|
if message_bus and tools and platform_unix and use_glib
|
||||||
scripts += [
|
scripts += [
|
||||||
{ 'name': 'test-dbus-daemon-fork.sh', },
|
{ 'name': 'test-dbus-daemon-fork.sh',
|
||||||
|
'test_deps': [ dbus_send ] },
|
||||||
{ 'name': 'transient-services.sh',
|
{ 'name': 'transient-services.sh',
|
||||||
'subdir': 'integration',
|
'subdir': 'integration',
|
||||||
'build_time_test': false },
|
'build_time_test': false },
|
||||||
|
|
@ -689,6 +700,7 @@ foreach script: scripts
|
||||||
name = script.get('name')
|
name = script.get('name')
|
||||||
install = script.get('install', true)
|
install = script.get('install', true)
|
||||||
suites = script.get('suite', ['dbus'])
|
suites = script.get('suite', ['dbus'])
|
||||||
|
test_deps = [xdgdir] + script.get('test_deps', [])
|
||||||
test_subdir = script.get('subdir', '')
|
test_subdir = script.get('subdir', '')
|
||||||
|
|
||||||
if test_subdir == ''
|
if test_subdir == ''
|
||||||
|
|
@ -715,7 +727,7 @@ foreach script: scripts
|
||||||
test(name,
|
test(name,
|
||||||
find_program(script.get('subdir', '.') / name),
|
find_program(script.get('subdir', '.') / name),
|
||||||
env: test_env,
|
env: test_env,
|
||||||
depends: xdgdir,
|
depends: test_deps,
|
||||||
suite: suites,
|
suite: suites,
|
||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -23,29 +23,38 @@
|
||||||
if embedded_tests
|
if embedded_tests
|
||||||
|
|
||||||
tests = [
|
tests = [
|
||||||
'test-ids',
|
{'name': 'test-ids'},
|
||||||
'test-pending-call-disconnected',
|
{'name': 'test-pending-call-disconnected'},
|
||||||
'test-shutdown',
|
{'name': 'test-shutdown'},
|
||||||
]
|
]
|
||||||
|
|
||||||
if platform_windows
|
if platform_windows
|
||||||
tests += ['test-autolaunch-win']
|
autolaunch_name = 'test-autolaunch-win'
|
||||||
else
|
else
|
||||||
tests += ['test-autolaunch']
|
autolaunch_name = 'test-autolaunch'
|
||||||
endif
|
endif
|
||||||
|
autolaunch = executable(autolaunch_name,
|
||||||
|
autolaunch_name + '.c',
|
||||||
|
include_directories: root_include,
|
||||||
|
link_with: [libdbus, libdbus_internal, libdbus_testutils],
|
||||||
|
dependencies: dbus_dependencies
|
||||||
|
)
|
||||||
|
|
||||||
if use_traditional_activation
|
if use_traditional_activation
|
||||||
tests += [
|
tests += [
|
||||||
'test-pending-call-dispatch',
|
{'name': 'test-pending-call-dispatch', 'test_deps': [test_service]},
|
||||||
'test-pending-call-timeout',
|
{'name': 'test-pending-call-timeout', 'test_deps': [test_service]},
|
||||||
'test-privserver-client',
|
{
|
||||||
'test-threads-init',
|
'name': 'test-privserver-client',
|
||||||
|
'test_deps': [test_privserver, test_service],
|
||||||
|
},
|
||||||
|
{'name': 'test-threads-init', 'test_deps': [test_service]},
|
||||||
]
|
]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
foreach test: tests
|
foreach test: tests
|
||||||
test_exe = executable(test,
|
test_exe = executable(test['name'],
|
||||||
test + '.c',
|
test['name'] + '.c',
|
||||||
include_directories: root_include,
|
include_directories: root_include,
|
||||||
link_with: [
|
link_with: [
|
||||||
libdbus,
|
libdbus,
|
||||||
|
|
@ -55,12 +64,12 @@ if embedded_tests
|
||||||
dependencies: dbus_dependencies,
|
dependencies: dbus_dependencies,
|
||||||
)
|
)
|
||||||
|
|
||||||
if test == 'test-autolaunch'
|
if test['name'] == 'test-autolaunch'
|
||||||
# This one is run from run-test.sh, not directly
|
# This one is run from run-test.sh, not directly
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if test == 'test-pending-call-timeout'
|
if test['name'] == 'test-pending-call-timeout'
|
||||||
timeout = 75
|
timeout = 75
|
||||||
suites = ['name-test', 'slow']
|
suites = ['name-test', 'slow']
|
||||||
else
|
else
|
||||||
|
|
@ -68,7 +77,7 @@ if embedded_tests
|
||||||
suites = ['name-test']
|
suites = ['name-test']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
test(test,
|
test(test['name'],
|
||||||
dbus_run_session,
|
dbus_run_session,
|
||||||
args: [
|
args: [
|
||||||
'--config-file=@0@'.format(
|
'--config-file=@0@'.format(
|
||||||
|
|
@ -77,6 +86,7 @@ if embedded_tests
|
||||||
'--',
|
'--',
|
||||||
test_exe,
|
test_exe,
|
||||||
],
|
],
|
||||||
|
depends: test.get('test_deps', []),
|
||||||
env: test_env,
|
env: test_env,
|
||||||
protocol: test_protocol,
|
protocol: test_protocol,
|
||||||
suite: suites,
|
suite: suites,
|
||||||
|
|
@ -88,6 +98,7 @@ if embedded_tests
|
||||||
if platform_unix
|
if platform_unix
|
||||||
test('run-test',
|
test('run-test',
|
||||||
find_program('run-test.sh'),
|
find_program('run-test.sh'),
|
||||||
|
depends: autolaunch,
|
||||||
env: test_env,
|
env: test_env,
|
||||||
protocol: test_protocol,
|
protocol: test_protocol,
|
||||||
suite: 'name-test',
|
suite: 'name-test',
|
||||||
|
|
@ -95,6 +106,7 @@ if embedded_tests
|
||||||
|
|
||||||
test('run-test-systemserver',
|
test('run-test-systemserver',
|
||||||
find_program('run-test-systemserver.sh'),
|
find_program('run-test-systemserver.sh'),
|
||||||
|
depends: [dbus_send, test_service],
|
||||||
env: test_env,
|
env: test_env,
|
||||||
protocol: test_protocol,
|
protocol: test_protocol,
|
||||||
suite: 'name-test',
|
suite: 'name-test',
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue