glib/tests/gobject/meson.build
Emmanuele Bassi 3c03cc8f68 meson: Simplify the use of built tools
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.
2017-07-17 11:05:07 +01:00

60 lines
2.0 KiB
Meson

gobject_tests = [
['gvalue-test'],
['paramspec-test'],
['deftype'],
['defaultiface', ['defaultiface.c', 'testmodule.c']],
['dynamictype', ['dynamictype.c', 'testmodule.c']],
['override'],
['signals'],
['singleton'],
['references'],
]
# The marshal test requires running a binary, which means we cannot
# build it when cross-compiling
if not meson.is_cross_build() or meson.has_exe_wrapper()
gnome = import('gnome')
testmarshal_srcs = gnome.genmarshal('testmarshal',
sources : 'testmarshal.list',
prefix : 'test_marshal')
gobject_tests += [
['accumulator', ['accumulator.c', testmarshal_srcs]],
]
endif
foreach t : gobject_tests
test_name = t.get(0)
test_src = t.get(1, test_name + '.c')
test_extra_cargs = t.get(2, [])
test_timeout = t.get(3, 30)
# FIXME? $(GLIB_DEBUG_FLAGS)
exe = executable(test_name + '-gobject', test_src,
c_args : test_cargs + test_extra_cargs + ['-DGLIB_DISABLE_DEPRECATION_WARNINGS'],
dependencies : [libm, thread_dep, libglib_dep, libgobject_dep],
install : false,
)
# FIXME? TESTS_ENVIRONMENT = LIBCHARSET_ALIAS_DIR=$(top_builddir)/glib/libcharset
test(test_name, exe, env : test_env, timeout : test_timeout)
endforeach
# Don't install these ones, and keep them out of 'make check' because they take too long...
executable('performance', 'performance.c',
c_args : test_cargs + test_extra_cargs + ['-DGLIB_DISABLE_DEPRECATION_WARNINGS'],
dependencies : [libm, thread_dep, libglib_dep, libgobject_dep],
install : false)
executable('performance-threaded', 'performance-threaded.c',
c_args : test_cargs + test_extra_cargs + ['-DGLIB_DISABLE_DEPRECATION_WARNINGS'],
dependencies : [libm, thread_dep, libglib_dep, libgobject_dep],
install : false)
if host_system != 'windows' and host_system != 'minix'
executable('timeloop-closure', 'timeloop-closure.c',
c_args : test_cargs + test_extra_cargs + ['-DGLIB_DISABLE_DEPRECATION_WARNINGS'],
dependencies : [libm, thread_dep, libglib_dep, libgobject_dep],
install : false)
endif