From 8ab88d18af05d2c9c79244166f8e4ff3d6cae051 Mon Sep 17 00:00:00 2001 From: Niels De Graef Date: Wed, 15 Jan 2025 22:05:38 +0100 Subject: [PATCH] meson: Make dbus-run-session optional Although it most probably makes sense for anyone who wants to run the tests, there's always a possibility someone wants to use a different setup instead. Fixes: https://gitlab.gnome.org/GNOME/libsecret/-/issues/100 --- meson.build | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 0548218..71ff7d2 100644 --- a/meson.build +++ b/meson.build @@ -101,11 +101,16 @@ configure_file(output: 'config.h', configuration: conf) test_env = environment() test_env.set('abs_top_builddir', meson.build_root()) -# Most tests require a D-Bus session -add_test_setup('dbus', - exe_wrapper: find_program('dbus-run-session'), - is_default: true, -) +# Most tests require a D-Bus session, so try to wrap automatically with dbus-run-session +dbus_run_session = find_program('dbus-run-session', required: false) +if dbus_run_session.found() + add_test_setup('dbus', + exe_wrapper: dbus_run_session, + is_default: true, + ) +else + message('dbus-run-session not found. Please note that tests might fail if you don\'t set up a D-Bus session.') +endif # Subfolders subdir('po')