mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 23:46:15 +01:00
3c03cc8f68
The Meson build has fallen a bit behind the Autotools one, when it comes to the internally built tools like glib-mkenums and glib-genmarshals. We don't need to generate gmarshal.strings any more, and since the glib-genmarshal tool is now written in Python it can also be used when cross-compiling, and without indirection, just like we use glib-mkenums. We can also coalesce various rules into a simple array iteration, with minimal changes to glib-mkenums, thus making the build a bit more resilient and without unnecessary duplication.
81 lines
1.9 KiB
Meson
81 lines
1.9 KiB
Meson
gobject_tests = [
|
|
'qdata',
|
|
'boxed',
|
|
'enums',
|
|
'param',
|
|
'threadtests',
|
|
'dynamictests',
|
|
'binding',
|
|
'properties',
|
|
'reference',
|
|
'value',
|
|
'type',
|
|
'private',
|
|
'closure',
|
|
'object',
|
|
'signal-handler',
|
|
'ifaceproperties',
|
|
]
|
|
|
|
# FIXME: use new environment() object
|
|
# 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 = [
|
|
'G_TEST_SRCDIR=' + meson.current_source_dir(),
|
|
'G_TEST_BUILDDIR=' + meson.current_build_dir(),
|
|
'G_DEBUG=gc-friendly',
|
|
'MALLOC_CHECK_=2',
|
|
'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 : ['-DHAVE_CONFIG_H=1', '-DG_LOG_DOMAIN="GLib-GObject"'],
|
|
dependencies : deps,
|
|
)
|
|
test(test_name, exe, env : test_env)
|
|
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 : ['-DHAVE_CONFIG_H=1', '-DG_LOG_DOMAIN="GLib-GObject"'],
|
|
dependencies : deps,
|
|
)
|
|
test('signals', exe, env : test_env)
|