glib/gobject/tests/meson.build
Christoph Reiter 631c3534b7 meson: use the new 'python' module instead of the 'python3' one. Closes #1455
The new python module, added with 0.46, works with Python 2 and 3 and
allows to pass a path for the interpreter to use, if the need arises.

Previously the meson build set PYTHON, used in the shebang line of
the scripts installed by glib, to the full path of the interpreter.
The new meson module doesn't expose that atm, but we should set it to
a executable name anyway, and not a full path.
2018-07-19 12:32:29 +02:00

87 lines
2.0 KiB
Meson

gobject_tests = [
'qdata',
'boxed',
'enums',
'param',
'threadtests',
'dynamictests',
'binding',
'properties',
'reference',
'value',
'type',
'private',
'closure',
'object',
'signal-handler',
'ifaceproperties',
]
# FIXME: put common bits of test environment() in one location
# Not entirely random of course, but at least it changes over time
random_number = minor_version + meson.version().split('.').get(1).to_int()
test_env = environment()
test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
test_env.set('G_DEBUG', 'gc-friendly')
test_env.set('MALLOC_CHECK_', '2')
test_env.set('MALLOC_PERTURB_', '@0@'.format(random_number % 256))
foreach test_name : gobject_tests
deps = [libm, thread_dep, libglib_dep, libgobject_dep]
test_src = '@0@.c'.format(test_name)
# private is an existing or reserved target it seems
if test_name == 'private'
test_name = 'gobject-private'
endif
exe = executable(test_name, test_src,
c_args : ['-DG_LOG_DOMAIN="GLib-GObject"'],
dependencies : deps,
)
test(test_name, exe, env : test_env, suite : ['gobject'])
endforeach
marshalers_h = custom_target('marshalers_h',
output : 'marshalers.h',
input : 'marshalers.list',
command : [
python, glib_genmarshal,
'--prefix=test',
'--valist-marshallers',
'--output=@OUTPUT@',
'--quiet',
'--header',
'@INPUT@',
],
)
marshalers_c = custom_target('marshalers_c',
output : 'marshalers.c',
input : 'marshalers.list',
command : [
python, glib_genmarshal,
'--prefix=test',
'--valist-marshallers',
'--include-header=marshalers.h',
'--output=@OUTPUT@',
'--quiet',
'--body',
'@INPUT@',
],
)
exe = executable('signals',
'signals.c', marshalers_h, marshalers_c,
c_args : ['-DG_LOG_DOMAIN="GLib-GObject"'],
dependencies : deps,
)
test('signals', exe, env : test_env, suite : ['gobject'])
test(
'mkenums.py',
python,
args: files('mkenums.py'),
env: test_env,
suite: ['gobject'],
)