2021-06-09 11:46:24 +03:00
|
|
|
valgrind = find_program('valgrind', required: false)
|
|
|
|
|
if valgrind.found()
|
|
|
|
|
|
|
|
|
|
glib_supp = get_option('glib-supp')
|
|
|
|
|
if glib_supp == ''
|
2021-10-15 12:12:20 +03:00
|
|
|
glib_supp = glib_dep.get_variable(pkgconfig: 'prefix')
|
2021-06-09 11:46:24 +03:00
|
|
|
glib_supp = glib_supp / 'share' / 'glib-2.0' / 'valgrind' / 'glib.supp'
|
|
|
|
|
endif
|
|
|
|
|
if fs.is_file(glib_supp)
|
|
|
|
|
message('Using glib.supp:', glib_supp)
|
|
|
|
|
else
|
|
|
|
|
message('glib.supp not found, valgrind tests will not work correctly')
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
valgrind_env = environment({
|
|
|
|
|
'G_SLICE': 'always-malloc',
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
add_test_setup('valgrind',
|
|
|
|
|
exe_wrapper: [ valgrind,
|
|
|
|
|
'--suppressions=' + glib_supp,
|
|
|
|
|
'--leak-check=full',
|
|
|
|
|
'--gen-suppressions=all',
|
|
|
|
|
'--error-exitcode=3',
|
2021-06-09 15:43:08 +03:00
|
|
|
'--keep-debuginfo=yes',
|
2021-06-09 11:46:24 +03:00
|
|
|
],
|
|
|
|
|
env: valgrind_env,
|
|
|
|
|
timeout_multiplier: 2)
|
|
|
|
|
endif
|
|
|
|
|
|
2021-06-18 19:34:25 +03:00
|
|
|
# The common test environment
|
|
|
|
|
common_test_env = environment({
|
2021-06-30 11:47:00 +03:00
|
|
|
'HOME': '/invalid',
|
|
|
|
|
'XDG_RUNTIME_DIR': '/invalid',
|
2021-07-02 16:21:23 +03:00
|
|
|
'PIPEWIRE_RUNTIME_DIR': '/tmp',
|
2021-06-18 19:34:25 +03:00
|
|
|
'XDG_CONFIG_HOME': meson.current_build_dir() / '.config',
|
2021-08-19 10:39:14 +03:00
|
|
|
'XDG_STATE_HOME': meson.current_build_dir() / '.local' / 'state',
|
2021-08-02 13:32:16 -04:00
|
|
|
'FILE_MONITOR_DIR': meson.current_build_dir() / '.local' / 'file_monitor',
|
2022-11-25 06:51:04 +05:30
|
|
|
'WIREPLUMBER_DATA_DIR': meson.current_source_dir() / '..' / 'src',
|
2021-06-18 19:34:25 +03:00
|
|
|
'WIREPLUMBER_MODULE_DIR': meson.current_build_dir() / '..' / 'modules',
|
2023-06-22 13:06:18 +03:00
|
|
|
'WIREPLUMBER_DEBUG': 'T,pw.*:I,spa.*:I,mod.*:I',
|
2021-06-18 19:34:25 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
spa_plugindir = spa_dep.get_variable(
|
|
|
|
|
pkgconfig: 'plugindir', internal: 'plugindir', default_value: '')
|
|
|
|
|
pipewire_moduledir = pipewire_dep.get_variable(
|
|
|
|
|
pkgconfig: 'moduledir', internal: 'moduledir', default_value: '')
|
|
|
|
|
pipewire_confdatadir = pipewire_dep.get_variable(
|
|
|
|
|
pkgconfig: 'confdatadir', internal: 'confdatadir', default_value: '')
|
|
|
|
|
|
|
|
|
|
if spa_plugindir != ''
|
|
|
|
|
common_test_env.set('SPA_PLUGIN_DIR', spa_plugindir)
|
|
|
|
|
endif
|
|
|
|
|
if pipewire_moduledir != ''
|
|
|
|
|
common_test_env.set('PIPEWIRE_MODULE_DIR', pipewire_moduledir)
|
|
|
|
|
endif
|
|
|
|
|
if pipewire_confdatadir != ''
|
|
|
|
|
common_test_env.set('PIPEWIRE_CONFIG_DIR', pipewire_confdatadir)
|
|
|
|
|
endif
|
|
|
|
|
|
2019-09-09 08:52:36 -04:00
|
|
|
subdir('wp')
|
2022-11-16 11:29:13 +01:00
|
|
|
if build_modules
|
|
|
|
|
subdir('wplua')
|
2022-11-28 05:23:57 +05:30
|
|
|
subdir('scripts')
|
2022-11-16 11:29:13 +01:00
|
|
|
subdir('modules')
|
|
|
|
|
endif
|
2024-06-15 14:05:27 +03:00
|
|
|
subdir('examples')
|