Debian Codegraph @

tests/meson.build

raw
1 gnome = import('gnome')
2
3 host_system = host_machine.system()
4
5 cc = meson.get_compiler('c')
6
7 helper_sources = [
8 'testhelpermodule.c',
9 'test-floating.c',
10 'test-thread.c',
11 'test-unknown.c']
12
13 helperext = python.extension_module('testhelper', helper_sources,
14 dependencies : [python_dep, glib_dep, gobject_dep, pythoncapi_compat_dep],
15 c_args: pyext_c_args + main_c_args,
16 include_directories: include_directories(join_paths('..', 'gi'))
17 )
18
19 schemas = gnome.compile_schemas(build_by_default: true)
20
21 envdata = environment()
22 if host_machine.system() == 'windows'
23 envdata.prepend('PATH', join_paths(get_option('prefix'), get_option('bindir')))
24 endif
25
26 test_deps = [
27 giext,
28 helperext,
29 schemas,
30 gi_tests.get_variable('gimarshallingtests_typelib'),
31 gi_tests.get_variable('regress_typelib'),
32 gi_tests.get_variable('utility_typelib')]
33
34 python_paths = [join_paths(meson.current_build_dir(), '..')]
35 if pycairo_dep.found() and pycairo_dep.type_name() == 'internal'
36 python_paths += [join_paths(meson.project_build_root(), 'subprojects', 'pycairo')]
37 test_deps += [gicairoext]
38 endif
39 envdata.append('PYTHONPATH', python_paths)
40 envdata.prepend('PYTHONPATH', meson.current_build_dir())
41
42 gi_tests_builddir = meson.project_build_root() / 'subprojects' / 'gobject-introspection-tests'
43 envdata.prepend('LD_LIBRARY_PATH', gi_tests_builddir)
44 envdata.prepend('GI_TYPELIB_PATH', gi_tests_builddir)
45 envdata.prepend('GSETTINGS_SCHEMA_DIR', meson.current_build_dir())
46 envdata.set('GSETTINGS_BACKEND', 'memory')
47
48 test('pygobject-test-suite',
49 python,
50 args: ['-m', 'pytest'],
51 workdir: meson.project_source_root(),
52 env: envdata,
53 timeout: 90,
54 depends: test_deps)