From 2a7ff6241735b09bb7147bfc0c8d083a1946d129 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 21 Nov 2023 14:21:07 +0000 Subject: [PATCH] tests: Improve build of cmph tests in girepository MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They were still failing with `-Dglib_assert=false` because `G_DISABLE_ASSERT` wasn’t being explicitly un-defined for the test. See https://gitlab.gnome.org/GNOME/glib/-/jobs/3309889 Also while we’re there, take the opportunity to correctly set the test suite, protocol and environment. Signed-off-by: Philip Withnall --- girepository/cmph/meson.build | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/girepository/cmph/meson.build b/girepository/cmph/meson.build index e0d5b27f1..2f4160f85 100644 --- a/girepository/cmph/meson.build +++ b/girepository/cmph/meson.build @@ -65,13 +65,22 @@ if cc.get_id() != 'msvc' ]) endif +test_env = environment() +test_env.set('G_TEST_SRCDIR', meson.current_source_dir()) +test_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) + cmph_test = executable('cmph-bdz-test', '../cmph-bdz-test.c', dependencies: [ cmph_dep, libglib_dep, libgobject_dep, ], - c_args: custom_c_args, + c_args: custom_c_args + ['-UG_DISABLE_ASSERT'], ) -test('cmph-bdz-test', cmph_test) +test('cmph-bdz-test', cmph_test, + env: test_env, + protocol: test_protocol, + suite: ['girepository'], + timeout: test_timeout, +)