1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
test_env = environment()
test_env.set('G_DEBUG', 'fatal-criticals')
dbus_run_session = find_program('dbus-run-session', required: false)
py = python.find_installation('python3',
modules: ['dbus', 'dbusmock'],
required: false)
xvfb_run = find_program('xvfb-run', required: false)
if not dbus_run_session.found() or not py.found()
subdir_done()
endif
add_test_setup(
'default',
is_default: true,
exclude_suites: ['interactive'] + (xvfb_run.found() ? [] : ['graphical']),
exe_wrapper: [
xvfb_run.found() ? [xvfb_run, '-a'] : [],
dbus_run_session, '--',
py, '-m', 'dbusmock', '--session', '-t', 'notification_daemon', '-e',
],
env: test_env,
)
test_progs = {
'replace': {},
'replace-widget': {'suites': 'interactive'},
'server-info': {},
'default-action': {'suites': 'interactive'},
'multi-actions': {'suites': 'interactive'},
'action-icons': {'suites': 'interactive'},
'image': {
'suites': 'graphical',
'depends': [
fs.copyfile(files('applet-critical.png'), 'applet-critical.png'),
fs.copyfile(files('dewdop_leaf.jpg'), 'dewdop_leaf.jpg'),
],
},
'basic': {},
'error': {},
'markup': {},
'persistence': {'suites': 'graphical'},
'removal': {'suites': 'interactive'},
'resident': {'suites': 'interactive'},
'rtl': {},
'size-changes': {},
'transient': {'suites': 'interactive'},
'urgency': {},
'xy': {},
'xy-actions': {'suites': 'interactive'},
'xy-stress': {'suites': 'interactive'},
}
foreach tprog, tprop: test_progs
t = executable('test-' + tprog, ['test-' + tprog + '.c'],
dependencies: [libnotify_dep, tests_deps],
)
test('test-' + tprog, t,
suite: tprop.get('suites', []),
depends: tprop.get('depends', []),
workdir: meson.current_build_dir(),
)
endforeach
test('test-notify-send', py,
args: files('test_notify_send.py'),
depends: tool_notify_send,
timeout: 60,
env: {
'NOTIFY_SEND': tool_notify_send.full_path(),
},
)
|