| 1 |
valgrind = find_program('valgrind', required: false) |
| 2 |
if valgrind.found() |
| 3 |
|
| 4 |
glib_supp = get_option('glib-supp') |
| 5 |
if glib_supp == '' |
| 6 |
glib_supp = glib_dep.get_variable(pkgconfig: 'prefix') |
| 7 |
glib_supp = glib_supp / 'share' / 'glib-2.0' / 'valgrind' / 'glib.supp' |
| 8 |
endif |
| 9 |
if fs.is_file(glib_supp) |
| 10 |
message('Using glib.supp:', glib_supp) |
| 11 |
else |
| 12 |
message('glib.supp not found, valgrind tests will not work correctly') |
| 13 |
endif |
| 14 |
|
| 15 |
valgrind_env = environment({ |
| 16 |
'G_SLICE': 'always-malloc', |
| 17 |
}) |
| 18 |
|
| 19 |
add_test_setup('valgrind', |
| 20 |
exe_wrapper: [ valgrind, |
| 21 |
'--suppressions=' + glib_supp, |
| 22 |
'--leak-check=full', |
| 23 |
'--gen-suppressions=all', |
| 24 |
'--error-exitcode=3', |
| 25 |
'--keep-debuginfo=yes', |
| 26 |
], |
| 27 |
env: valgrind_env, |
| 28 |
timeout_multiplier: 2) |
| 29 |
endif |
| 30 |
|
| 31 |
# The common test environment |
| 32 |
common_test_env = environment({ |
| 33 |
'HOME': '/invalid', |
| 34 |
'XDG_RUNTIME_DIR': '/invalid', |
| 35 |
'PIPEWIRE_RUNTIME_DIR': '/tmp', |
| 36 |
'XDG_CONFIG_HOME': meson.current_build_dir() / '.config', |
| 37 |
'XDG_STATE_HOME': meson.current_build_dir() / '.local' / 'state', |
| 38 |
'FILE_MONITOR_DIR': meson.current_build_dir() / '.local' / 'file_monitor', |
| 39 |
'WIREPLUMBER_DATA_DIR': meson.current_source_dir() / '..' / 'src', |
| 40 |
'WIREPLUMBER_MODULE_DIR': meson.current_build_dir() / '..' / 'modules', |
| 41 |
'WIREPLUMBER_DEBUG': 'T,pw.*:I,spa.*:I,mod.*:I', |
| 42 |
}) |
| 43 |
|
| 44 |
spa_plugindir = spa_dep.get_variable( |
| 45 |
pkgconfig: 'plugindir', internal: 'plugindir', default_value: '') |
| 46 |
pipewire_moduledir = pipewire_dep.get_variable( |
| 47 |
pkgconfig: 'moduledir', internal: 'moduledir', default_value: '') |
| 48 |
pipewire_confdatadir = pipewire_dep.get_variable( |
| 49 |
pkgconfig: 'confdatadir', internal: 'confdatadir', default_value: '') |
| 50 |
|
| 51 |
if spa_plugindir != '' |
| 52 |
common_test_env.set('SPA_PLUGIN_DIR', spa_plugindir) |
| 53 |
endif |
| 54 |
if pipewire_moduledir != '' |
| 55 |
common_test_env.set('PIPEWIRE_MODULE_DIR', pipewire_moduledir) |
| 56 |
endif |
| 57 |
if pipewire_confdatadir != '' |
| 58 |
common_test_env.set('PIPEWIRE_CONFIG_DIR', pipewire_confdatadir) |
| 59 |
endif |
| 60 |
|
| 61 |
subdir('wp') |
| 62 |
if build_modules |
| 63 |
subdir('wplua') |
| 64 |
subdir('scripts') |
| 65 |
subdir('modules') |
| 66 |
endif |
| 67 |
subdir('examples') |