diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2017-05-02 17:04:58 +0100 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-07-13 19:03:39 -0400 |
commit | 2e9fd74b2576d276e246655aef7c40e04e51ea9e (patch) | |
tree | a166bcfaad31eb56f6478f5e1da2e0ac86b66a56 /tests | |
parent | 6af4f1752a44384290f378594c9fb7f655e31682 (diff) | |
download | glib-2e9fd74b2576d276e246655aef7c40e04e51ea9e.tar.gz |
meson: add tests/gobject and tests/refcount
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gobject/meson.build | 59 | ||||
-rw-r--r-- | tests/meson.build | 14 | ||||
-rw-r--r-- | tests/refcount/meson.build | 29 |
3 files changed, 102 insertions, 0 deletions
diff --git a/tests/gobject/meson.build b/tests/gobject/meson.build new file mode 100644 index 000000000..e10a34590 --- /dev/null +++ b/tests/gobject/meson.build @@ -0,0 +1,59 @@ +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, 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 diff --git a/tests/meson.build b/tests/meson.build new file mode 100644 index 000000000..694e1790f --- /dev/null +++ b/tests/meson.build @@ -0,0 +1,14 @@ +# tests + +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), +] + +test_cargs = ['-DHAVE_CONFIG_H=1', '-DG_LOG_DOMAIN="GLib"'] + +subdir('gobject') +subdir('refcount') diff --git a/tests/refcount/meson.build b/tests/refcount/meson.build new file mode 100644 index 000000000..64c0cfbfd --- /dev/null +++ b/tests/refcount/meson.build @@ -0,0 +1,29 @@ +refcount_tests = [ + ['closures', 'closures.c', []], + ['objects', 'objects.c', []], + ['objects2', 'objects2.c', []], + ['properties', 'properties.c', []], + ['properties2', 'properties2.c', []], + ['properties3', 'properties3.c', [], 90], # extra long timeout + ['properties4', 'properties4.c', []], + ['signal1', 'signals.c', ['-DTESTNUM=1']], + ['signal2', 'signals.c', ['-DTESTNUM=2']], + ['signal3', 'signals.c', ['-DTESTNUM=3']], + ['signal4', 'signals.c', ['-DTESTNUM=4']], +] + +foreach t : refcount_tests + test_name = t.get(0) + test_src = t.get(1) + test_extra_cargs = t.get(2) + test_timeout = t.get(3, 30) + + # FIXME? $(GLIB_DEBUG_FLAGS) + exe = executable(test_name + '-test', 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 |