mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 23:16:14 +01:00
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 <withnall@endlessm.com> Fixes: #1708
This commit is contained in:
parent
f3610f14c4
commit
d89f18bb22
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user