summaryrefslogtreecommitdiff
path: root/test/py/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'test/py/meson.build')
-rw-r--r--test/py/meson.build17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/py/meson.build b/test/py/meson.build
index 2affdbd4..0b679d31 100644
--- a/test/py/meson.build
+++ b/test/py/meson.build
@@ -4,14 +4,29 @@ if not pycamera_enabled
subdir_done()
endif
+# If ASan is enabled, the link order runtime check will fail as Python is not
+# linked to ASan. LD_PRELOAD the ASan runtime if available, or skip the test
+# otherwise.
+
+if asan_runtime_missing
+ warning('Unable to get path to ASan runtime, Python test disabled')
+ subdir_done()
+endif
+
pymod = import('python')
py3 = pymod.find_installation('python3')
pypathdir = meson.project_build_root() / 'src' / 'py'
+py_env = ['PYTHONPATH=' + pypathdir]
+
+if asan_enabled
+ # Disable leak detection as the Python interpreter is full of leaks.
+ py_env += ['LD_PRELOAD=' + asan_runtime, 'ASAN_OPTIONS=detect_leaks=0']
+endif
test('pyunittests',
py3,
args : files('unittests.py'),
- env : ['PYTHONPATH=' + pypathdir],
+ env : py_env,
suite : 'pybindings',
is_parallel : false)