summaryrefslogtreecommitdiff
path: root/test/v4l2_compat/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'test/v4l2_compat/meson.build')
-rw-r--r--test/v4l2_compat/meson.build33
1 files changed, 21 insertions, 12 deletions
diff --git a/test/v4l2_compat/meson.build b/test/v4l2_compat/meson.build
index 87809589..2691eacf 100644
--- a/test/v4l2_compat/meson.build
+++ b/test/v4l2_compat/meson.build
@@ -1,20 +1,29 @@
# SPDX-License-Identifier: CC0-1.0
-# If ASan is enabled, the link order runtime check will fail as v4l2-ctl and
-# v4l2-compliance are not linked to ASan. Skip the test in that case.
-#
-# TODO: Find a way to LD_PRELOAD the ASan dynamic library instead, in a
-# cross-platform way with support for both gcc and clang.
+if not is_variable('v4l2_compat')
+ subdir_done()
+endif
+
+# If ASan is enabled but the ASan runtime shared library is missing,
+# v4l2_compat_test.py won't be able to LD_PRELOAD it, resulting in a link order
+# runtime check failure as v4l2-ctl and v4l2-compliance are not linked to ASan.
+# Skip the test in that case.
-if get_option('b_sanitize').contains('address')
+if asan_runtime_missing
+ warning('Unable to get path to ASan runtime, v4l2_compat test disabled')
subdir_done()
endif
-if is_variable('v4l2_compat')
- v4l2_compat_test = files('v4l2_compat_test.py')
+v4l2_compat_test = files('v4l2_compat_test.py')
+v4l2_compat_args = []
- test('v4l2_compat_test', v4l2_compat_test,
- args : v4l2_compat,
- suite : 'v4l2_compat',
- timeout : 60)
+if asan_enabled
+ v4l2_compat_args += ['-s', asan_runtime]
endif
+
+v4l2_compat_args += [v4l2_compat]
+
+test('v4l2_compat_test', v4l2_compat_test,
+ args : v4l2_compat_args,
+ suite : 'v4l2_compat',
+ timeout : 60)