link_with: libdbus_testutils,
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
test_spawn = executable('test-spawn',
'srcs': [ 'bus/helper-activation.c', 'bus/common.c' ],
'link': [ libdbus_testutils, libdbus_daemon_internal, ],
'install': false,
+ 'test_deps': [
+ launch_helper_for_tests,
+ test_segfault,
+ test_service,
+ test_shell_service,
+ ],
'suite': ['slow'],
'timeout': 1000,
},
'srcs': [ 'internals/spawn-oom.c', ],
'link': [ libdbus_testutils, ],
'install': false,
+ 'test_deps': [ test_exit, test_segfault ],
}
]
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 += [
{
'name': 'atomic',
'srcs': [ 'internals/sysdeps.c' ],
'link': [ libdbus_testutils, ],
'deps': [ glib, gio, ],
+ 'test_deps': [ test_sleep_forever ],
},
{
'name': 'syslog',
srcs = test.get('srcs')
link = test.get('link', [])
deps = test.get('deps', [])
+ test_deps = test.get('test_deps', [])
suites = test.get('suite', ['dbus'])
install = test.get('install', true)
- if suites.contains('runs-dbus-daemon') and not (message_bus and tools)
- continue
+ if suites.contains('runs-dbus-daemon')
+ if not (message_bus and tools)
+ continue
+ endif
+ test_deps += dbus_daemon
endif
if test.get('test', true)
test(name,
test_exe,
args: ['--tap'],
+ depends: test_deps,
env: test_env,
protocol: test_protocol,
suite: suites,
if message_bus and tools and platform_unix and use_glib
scripts += [
- { 'name': 'test-dbus-daemon-fork.sh', },
+ { 'name': 'test-dbus-daemon-fork.sh',
+ 'test_deps': [ dbus_send ] },
{ 'name': 'transient-services.sh',
'subdir': 'integration',
'build_time_test': false },
name = script.get('name')
install = script.get('install', true)
suites = script.get('suite', ['dbus'])
+ test_deps = [xdgdir] + script.get('test_deps', [])
test_subdir = script.get('subdir', '')
if test_subdir == ''
test(name,
find_program(script.get('subdir', '.') / name),
env: test_env,
- depends: xdgdir,
+ depends: test_deps,
suite: suites,
)
endif
if embedded_tests
tests = [
- 'test-ids',
- 'test-pending-call-disconnected',
- 'test-shutdown',
+ {'name': 'test-ids'},
+ {'name': 'test-pending-call-disconnected'},
+ {'name': 'test-shutdown'},
]
if platform_windows
- tests += ['test-autolaunch-win']
+ autolaunch_name = 'test-autolaunch-win'
else
- tests += ['test-autolaunch']
+ autolaunch_name = 'test-autolaunch'
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
tests += [
- 'test-pending-call-dispatch',
- 'test-pending-call-timeout',
- 'test-privserver-client',
- 'test-threads-init',
+ {'name': 'test-pending-call-dispatch', 'test_deps': [test_service]},
+ {'name': 'test-pending-call-timeout', 'test_deps': [test_service]},
+ {
+ 'name': 'test-privserver-client',
+ 'test_deps': [test_privserver, test_service],
+ },
+ {'name': 'test-threads-init', 'test_deps': [test_service]},
]
endif
foreach test: tests
- test_exe = executable(test,
- test + '.c',
+ test_exe = executable(test['name'],
+ test['name'] + '.c',
include_directories: root_include,
link_with: [
libdbus,
dependencies: dbus_dependencies,
)
- if test == 'test-autolaunch'
+ if test['name'] == 'test-autolaunch'
# This one is run from run-test.sh, not directly
continue
endif
- if test == 'test-pending-call-timeout'
+ if test['name'] == 'test-pending-call-timeout'
timeout = 75
suites = ['name-test', 'slow']
else
suites = ['name-test']
endif
- test(test,
+ test(test['name'],
dbus_run_session,
args: [
'--config-file=@0@'.format(
'--',
test_exe,
],
+ depends: test.get('test_deps', []),
env: test_env,
protocol: test_protocol,
suite: suites,
if platform_unix
test('run-test',
find_program('run-test.sh'),
+ depends: autolaunch,
env: test_env,
protocol: test_protocol,
suite: 'name-test',
test('run-test-systemserver',
find_program('run-test-systemserver.sh'),
+ depends: [dbus_send, test_service],
env: test_env,
protocol: test_protocol,
suite: 'name-test',