diff options
author | Simon McVittie <smcv@debian.org> | 2020-08-21 14:55:00 +0100 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2020-08-21 15:04:38 +0100 |
commit | e043511635ce8d627f40054d22a876f1c189db46 (patch) | |
tree | 64e0f86c2b57d0b9876a374de36fcd7f21d65642 | |
parent | 250a21f24365b6fed6271b5f235307d9fbef5eeb (diff) | |
download | gtk-doc-e043511635ce8d627f40054d22a876f1c189db46.tar.gz |
tests: Pass address-sanitizer options when building GObject scannerwip/smcv/qsort-null-test
This allows a Meson build with -Db_sanitize=address,undefined to
succeed (when combined with !52 to make the tests pass).
Reproduces: #125
Signed-off-by: Simon McVittie <smcv@debian.org>
-rw-r--r-- | tests/gobject/docs/meson.build | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/gobject/docs/meson.build b/tests/gobject/docs/meson.build index e1e6acc..7c6d9d9 100644 --- a/tests/gobject/docs/meson.build +++ b/tests/gobject/docs/meson.build @@ -38,6 +38,22 @@ test( ], ) +sanitizer_args = [] + +if get_option('b_sanitize') == 'address' or get_option('b_sanitize') == 'address,undefined' + sanitizer_args += [ + '--extra-cflags=-fsanitize=address', + '--ldflags=-fsanitize=address', + ] +endif + +if get_option('b_sanitize') == 'undefined' or get_option('b_sanitize') == 'address,undefined' + sanitizer_args += [ + '--extra-cflags=-fsanitize=undefined', + '--ldflags=-fsanitize=undefined', + ] +endif + test( 'test-gobject-scangobj', python_prg, @@ -51,6 +67,9 @@ test( '--extra-pkg=@0@'.format('gobject-2.0'), '--extra-lib=@0@'.format(gobject_test_lib.full_path()), '--module=@0@'.format('tester'), + ] + sanitizer_args, + env: [ + 'ASAN_OPTIONS=detect_leaks=0', ], ) |