diff --git a/test/meson.build b/test/meson.build index 43a59a254..b4f24cf1b 100644 --- a/test/meson.build +++ b/test/meson.build @@ -135,10 +135,15 @@ endif summary({'pactl': pactl.found()}, bool_yn: true, section: 'Functional test programs') if default_sm == 'media-session' or default_sm == 'wireplumber' + test_functional_c_args = [] + if get_option('b_sanitize').contains('address') + test_functional_c_args += ['-DHAVE_ASAN'] + endif test('test-functional', executable('test-functional', 'test-functional.c', include_directories: pwtest_inc, + c_args: [test_functional_c_args], dependencies: [ spa_dep ], link_with: pwtest_lib) ) diff --git a/test/pwtest.c b/test/pwtest.c index 5726fc744..7094a59e1 100644 --- a/test/pwtest.c +++ b/test/pwtest.c @@ -788,6 +788,7 @@ static void set_test_env(struct pwtest_context *ctx, struct pwtest_test *t) replace_env(t, "ACP_PROFILES_DIR", SOURCE_ROOT "/spa/plugins/alsa/mixer/profile-sets"); replace_env(t, "PIPEWIRE_LOG_SYSTEMD", "false"); replace_env(t, "PWTEST_DATA_DIR", SOURCE_ROOT "/test/data"); + replace_env(t, "LD_LIBRARY_PATH", BUILD_ROOT "/src/pipewire:" BUILD_ROOT "pipewire-jack/src"); } static void close_pipes(int fds[_FD_LAST]) diff --git a/test/test-functional.c b/test/test-functional.c index 8c3438688..29277ffb0 100644 --- a/test/test-functional.c +++ b/test/test-functional.c @@ -10,9 +10,14 @@ PWTEST(openal_info_test) { -#ifdef OPENAL_INFO_PATH + /* openal-info tries to load libpipewire, which would need + * LD_PRELOAD=/lib64/libasan.so.XX to work when ASan is enabled. Don't try to + * figure out the right preload, but just disable the test in that case. + */ +#if defined(OPENAL_INFO_PATH) && !defined(HAVE_ASAN) int status = pwtest_spawn(OPENAL_INFO_PATH, (char *[]){ "openal-info", NULL }); pwtest_int_eq(WEXITSTATUS(status), 0); + pwtest_int_eq(WIFSIGNALED(status), 0); return PWTEST_PASS; #else return PWTEST_SKIP; @@ -24,6 +29,7 @@ PWTEST(pactl_test) #ifdef PACTL_PATH int status = pwtest_spawn(PACTL_PATH, (char *[]){ "pactl", "info", NULL }); pwtest_int_eq(WEXITSTATUS(status), 0); + pwtest_int_eq(WIFSIGNALED(status), 0); return PWTEST_PASS; #else return PWTEST_SKIP;