mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-12 23:09:45 +03:00
test: py: Replace environment array with environment object
The environment for pyunittests is stored in an array. Meson provides an environment object, which makes handling of multi-value environment variables easier and increases code clarity. Switch to using the environment object. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
876730d805
commit
b3eba17213
1 changed files with 6 additions and 2 deletions
|
@ -13,15 +13,19 @@ if asan_runtime_missing
|
||||||
subdir_done()
|
subdir_done()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
py_env = environment()
|
||||||
|
|
||||||
pymod = import('python')
|
pymod = import('python')
|
||||||
py3 = pymod.find_installation('python3')
|
py3 = pymod.find_installation('python3')
|
||||||
|
|
||||||
pypathdir = meson.project_build_root() / 'src' / 'py'
|
pypathdir = meson.project_build_root() / 'src' / 'py'
|
||||||
py_env = ['PYTHONPATH=' + pypathdir]
|
py_env.append('PYTHONPATH', pypathdir)
|
||||||
|
|
||||||
if asan_enabled
|
if asan_enabled
|
||||||
|
py_env.append('LD_PRELOAD', asan_runtime)
|
||||||
|
|
||||||
# Disable leak detection as the Python interpreter is full of leaks.
|
# Disable leak detection as the Python interpreter is full of leaks.
|
||||||
py_env += ['LD_PRELOAD=' + asan_runtime, 'ASAN_OPTIONS=detect_leaks=0']
|
py_env.append('ASAN_OPTIONS', 'detect_leaks=0')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
test('pyunittests',
|
test('pyunittests',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue