File: meson.build

package info (click to toggle)
libcamera 0.5.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,380 kB
  • sloc: cpp: 81,540; python: 18,107; ansic: 12,608; sh: 1,258; makefile: 56
file content (42 lines) | stat: -rw-r--r-- 1,177 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# SPDX-License-Identifier: CC0-1.0

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

py_env = environment()

pymod = import('python')
py3 = pymod.find_installation('python3')

pypathdir = meson.project_build_root() / 'src' / 'py'
py_env.append('PYTHONPATH', pypathdir)

if asan_enabled
    py_env.append('LD_PRELOAD', asan_runtime)

    # Preload the C++ standard library to work around a bug in ASan when
    # dynamically loading C++ .so modules.
    stdlib = run_command(cxx, '-print-file-name=' + cxx_stdlib + '.so',
                         check : true).stdout().strip()
    py_env.append('LD_PRELOAD', stdlib)

    # Disable leak detection as the Python interpreter is full of leaks.
    py_env.append('ASAN_OPTIONS', 'detect_leaks=0')
endif

test('pyunittests',
     py3,
     args : files('unittests.py'),
     env : py_env,
     suite : 'pybindings',
     is_parallel : false)