Debian Codegraph @

testsuite/meson.build

raw
1 test_env = [
2 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
3 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
4 'G_DEBUG=gc-friendly',
5 'GSETTINGS_BACKEND=memory',
6 'MALLOC_CHECK_=2',
7 'NO_AT_BRIDGE=1',
8 ]
9
10 testsuite_c_args = [
11 '-DDEX_COMPILATION',
12 '-DG_LOG_DOMAIN="libdex"',
13 '-DG_ENABLE_DEBUG',
14 '-UG_DISABLE_ASSERT',
15 '-UG_DISABLE_CAST_CHECKS',
16 ]
17
18 dbus_foo = []
19 if have_gdbus_codegen
20 ext = meson.project_source_root() / 'src' / 'dex-gdbus-codegen-extension.py'
21 dbus_foo = gnome.gdbus_codegen(
22 'dex-test-dbus-foo',
23 sources: ['org.example.Foo.xml'],
24 interface_prefix: 'org.example',
25 namespace: 'DexTestDbus',
26 extra_args: [f'--extension-path=@ext@'],
27 )
28 endif
29
30 testsuite = {
31 'test-aio': {},
32 'test-async-result': {},
33 'test-channel': {},
34 'test-dbus': {'extra-sources': dbus_foo, 'disable': not have_gdbus_codegen, 'is_parallel': false},
35 'test-coroutine': {},
36 'test-object': {},
37 'test-fiber': {},
38 'test-future': {},
39 'test-future-list-model': {},
40 'test-limiter': {},
41 'test-scheduler': {},
42 'test-semaphore': {},
43 'test-state-machine': {},
44 'test-stream': {},
45 'test-task-group': {},
46 'test-test': {},
47 'test-thread': {},
48 'test-thread-pool': {},
49 'test-version': {},
50 'test-watch': {},
51 }
52
53 testsuite_deps = [
54 libdex_static_dep,
55 ]
56
57 if get_option('sysprof')
58 testsuite_deps += [libsysprof_capture_dep]
59 endif
60
61 foreach test, params: testsuite
62 if params.get('disable', false)
63 continue
64 endif
65
66 test_exe = executable(test,
67 sources: ['@[email protected]'.format(test)] + params.get('extra-sources', []),
68 c_args: testsuite_c_args + deprecated_c_args,
69 dependencies: testsuite_deps,
70 )
71
72 test(test, test_exe, env: test_env, is_parallel: params.get('is_parallel', true))
73 endforeach