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 '-DDEX_ENABLE_DEBUG',
13 '-DG_LOG_DOMAIN="libdex"',
14 '-DG_ENABLE_DEBUG',
15 '-UG_DISABLE_ASSERT',
16 '-UG_DISABLE_CAST_CHECKS',
17 ]
18
19 dbus_foo = []
20 if have_gdbus_codegen
21 ext = meson.project_source_root() / 'src' / 'dex-gdbus-codegen-extension.py'
22 dbus_foo = gnome.gdbus_codegen(
23 'dex-test-dbus-foo',
24 sources: ['org.example.Foo.xml'],
25 interface_prefix: 'org.example',
26 namespace: 'DexTestDbus',
27 extra_args: [f'--extension-path=@ext@'],
28 )
29 endif
30
31 testsuite = {
32 'test-async-result': {},
33 'test-channel': {},
34 'test-dbus': {'extra-sources': dbus_foo, 'disable': not have_gdbus_codegen},
35 'test-object': {},
36 'test-fiber': {},
37 'test-future': {},
38 'test-future-list-model': {},
39 'test-scheduler': {},
40 'test-semaphore': {},
41 'test-stream': {},
42 'test-thread': {},
43 'test-version': {},
44 'test-watch': {},
45 }
46
47 testsuite_deps = [
48 libdex_static_dep,
49 ]
50
51 if get_option('sysprof')
52 testsuite_deps += [libsysprof_capture_dep]
53 endif
54
55 foreach test, params: testsuite
56 if params.get('disable', false)
57 continue
58 endif
59
60 test_exe = executable(test,
61 sources: ['@[email protected]'.format(test)] + params.get('extra-sources', []),
62 c_args: testsuite_c_args + deprecated_c_args,
63 dependencies: testsuite_deps,
64 )
65
66 test(test, test_exe, env: test_env)
67 endforeach