3 marshalers_h = custom_target('marshalers_h',
4 output : 'marshalers.h',
5 input : 'marshalers.list',
7 python, glib_genmarshal,
9 '--valist-marshallers',
16 marshalers_c = custom_target('marshalers_c',
17 output : 'marshalers.c',
18 input : 'marshalers.list',
20 python, glib_genmarshal,
22 '--valist-marshallers',
23 '--include-header=marshalers.h',
31 # We must embed custom-dispatch.exe with an application
32 # manifest to pacify UAC in order to run on 32-bit Windows
33 # builds, otherwise the test will not run as UAC will kill it.
34 extra_custom_dispatch_objs = []
36 uac_exe_pkg = 'gobject'
37 uac_exe_name = 'custom-dispatch'
39 # Well, we have to forgo the xxx.exe.manifest in the output listing, since
40 # compile_resources doesn't like to consume targets with multiple outputs,
41 # and the xxx.exe.manifest and xxx.rc are tied together
42 uac_rc = custom_target(
43 '@0@.rc'.format(uac_exe_name),
44 output: ['@0@.rc'.format(uac_exe_name)],
45 command: [gen_uac_manifest,
46 '-p=@0@'.format(uac_exe_pkg),
47 '-n=@0@'.format(uac_exe_name),
48 '--pkg-version=@0@'.format(meson.project_version()),
49 '--output-dir=@OUTDIR@'],
51 extra_custom_dispatch_objs = import('windows').compile_resources(uac_rc)
58 'extra_objs' : extra_custom_dispatch_objs,
62 'source' : ['accumulator.c', marshalers_h, marshalers_c],
64 'basics-gobject' : {},
67 'source' : ['defaultiface.c', 'testmodule.c'],
69 'deftype' : { 'protocol': 'exitcode' },
70 'deprecated-properties' : {},
72 'source' : ['dynamictype.c', 'testmodule.c'],
75 'max-version' : {'install': false},
91 'source' : 'private.c',
94 'closure-refcount' : { 'suite': ['slow'] },
96 'signal-handler' : {},
97 'ifaceproperties' : {},
99 'source' : ['signals.c', marshalers_h, marshalers_c],
104 'objects-refcount1' : {
105 'c_args': cc.get_supported_arguments([
106 '-DG_DISABLE_CAST_CHECKS',
108 '-Wcast-align=strict',
111 'objects-refcount2' : {'suite' : ['slow']},
112 'properties-refcount1' : {},
113 'properties-refcount2' : {'suite' : ['slow']},
114 'properties-refcount3' : {'suite' : ['slow']},
115 'properties-refcount4' : {},
116 'signals-refcount1' : {
117 'source' : 'signals-refcount.c',
118 'c_args' : ['-DTESTNUM=1'],
120 'signals-refcount2' : {
121 'source' : 'signals-refcount.c',
122 'c_args' : ['-DTESTNUM=2'],
124 'signals-refcount3' : {
125 'source' : 'signals-refcount.c',
126 'c_args' : ['-DTESTNUM=3'],
128 'signals-refcount4' : {
129 'source' : 'signals-refcount.c',
130 'c_args' : ['-DTESTNUM=4'],
137 'protocol': 'exitcode',
138 'source' : ['cxx.cpp'],
143 foreach std, arg: cxx_standards
145 'cxx-@0@'.format(std) : {
146 'protocol': 'exitcode',
147 'source' : ['cxx.cpp'],
155 if cc.get_id() != 'msvc'
156 gobject_tests += {'autoptr' : {}}
160 'genmarshal.py' : {},
161 'gobject-query.py' : {
162 'depends' : gobject_query,
163 'can_fail' : host_system == 'windows',
168 test_env = environment()
169 test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
170 test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
172 test_deps = [libm, thread_dep, libglib_dep, libgobject_dep]
173 test_cargs = ['-DG_LOG_DOMAIN="GLib-GObject"', '-UG_DISABLE_ASSERT']
174 test_cpp_args = test_cargs
176 foreach test_name, extra_args : gobject_tests
177 source = extra_args.get('source', test_name + '.c')
178 extra_objs = extra_args.get('extra_objs', [])
179 install = installed_tests_enabled and extra_args.get('install', true)
182 test_conf = configuration_data()
183 test_conf.set('installed_tests_dir', installed_tests_execdir)
184 test_conf.set('program', test_name)
185 test_conf.set('env', '')
187 input: installed_tests_template_tap,
188 output: test_name + '.test',
189 install_dir: installed_tests_metadir,
190 install_tag: 'tests',
191 configuration: test_conf
195 exe = executable(test_name, source, extra_objs,
196 c_args : test_cargs + extra_args.get('c_args', []),
197 cpp_args : test_cpp_args + extra_args.get('cpp_args', []),
198 dependencies : test_deps + extra_args.get('dependencies', []),
199 install_dir: installed_tests_execdir,
200 install_tag: 'tests',
204 suite = ['gobject'] + extra_args.get('suite', [])
205 timeout = suite.contains('slow') ? test_timeout_slow : test_timeout
207 if extra_args.get('can_fail', false)
211 # FIXME: https://gitlab.gnome.org/GNOME/glib/issues/1316
212 # aka https://bugs.debian.org/880883
213 if test_name == 'closure-refcount' and ['arm', 'aarch64'].contains(host_machine.cpu_family())
214 timeout = timeout * 10
219 protocol : extra_args.get('protocol', test_protocol),
226 foreach test_name, extra_args : python_tests
227 depends = [extra_args.get('depends', [])]
228 suite = ['gobject', 'no-valgrind']
230 if extra_args.get('can_fail', false)
237 protocol : extra_args.get('protocol', test_protocol),
239 args: ['-B', files(test_name)],
244 if installed_tests_enabled
247 install_dir: installed_tests_execdir,
248 install_tag: 'tests',
249 install_mode: 'rwxr-xr-x',
252 test_conf = configuration_data()
253 test_conf.set('installed_tests_dir', installed_tests_execdir)
254 test_conf.set('program', test_name)
255 test_conf.set('env', '')
257 input: installed_tests_template_tap,
258 output: test_name + '.test',
259 install_dir: installed_tests_metadir,
260 install_tag: 'tests',
261 configuration: test_conf,
266 # TAP test runner for Python tests
267 if installed_tests_enabled
269 files('taptestrunner.py'),
270 install_dir: installed_tests_execdir,
271 install_tag: 'tests',