Debian Codegraph @

tests/meson.build

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