Commit d89f18bb authored by Philip Withnall's avatar Philip Withnall

build: Add -UG_DISABLE_ASSERT when building tests

In order to allow GLib itself to be built with G_DISABLE_ASSERT defined,
we need to explicitly undefine it when building the tests, otherwise
g_test_init() turns into an abort.
Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>

Fixes: #1708
parent f3610f14
......@@ -10,6 +10,7 @@ test_c_args = [
'-DTEST_SERVICES="@0@/gio/tests/services"'.format(meson.build_root()),
'-DGLIB_MKENUMS="@0@"'.format(glib_mkenums),
'-DGLIB_COMPILE_SCHEMAS="@0@"'.format(glib_compile_schemas.full_path()),
'-UG_DISABLE_ASSERT',
]
if host_machine.system() == 'windows'
......
......@@ -327,6 +327,7 @@ if host_system == 'windows'
else
gtester = executable('gtester', 'gtester.c',
install : true,
c_args : ['-UG_DISABLE_ASSERT'],
include_directories : configinc,
dependencies : [libglib_dep])
endif
......
......@@ -176,7 +176,7 @@ test_env.set('MALLOC_CHECK_', '2')
test_env.set('MALLOC_PERTURB_', '@0@'.format(random_number % 256))
test_deps = [libm, thread_dep, libglib_dep]
test_cargs = ['-DG_LOG_DOMAIN="GLib"']
test_cargs = ['-DG_LOG_DOMAIN="GLib"', '-UG_DISABLE_ASSERT']
foreach test_name, extra_args : glib_tests
source = extra_args.get('source', test_name + '.c')
......
......@@ -68,7 +68,7 @@ test_env.set('MALLOC_CHECK_', '2')
test_env.set('MALLOC_PERTURB_', '@0@'.format(random_number % 256))
test_deps = [libm, thread_dep, libglib_dep, libgobject_dep]
test_cargs = ['-DG_LOG_DOMAIN="GLib-GObject"']
test_cargs = ['-DG_LOG_DOMAIN="GLib-GObject"', '-UG_DISABLE_ASSERT']
foreach test_name, extra_args : gobject_tests
source = extra_args.get('source', test_name + '.c')
......
......@@ -10,7 +10,7 @@ test_env.set('G_DEBUG', 'gc-friendly')
test_env.set('MALLOC_CHECK_', '2')
test_env.set('MALLOC_PERTURB_', '@0@'.format(random_number % 256))
test_cargs = ['-DG_LOG_DOMAIN="GLib"']
test_cargs = ['-DG_LOG_DOMAIN="GLib"', '-UG_DISABLE_ASSERT']
subdir('gobject')
subdir('refcount')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment