From 65f10c8537f794314c0055764d70d474d79cd558 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 5 May 2015 12:27:09 +0300 Subject: [PATCH] build: Check if dbus-run-session for unit tests This checks if dbus-run-session is available and then add it to AM_TESTS_ENVIRONMENT so tests using D-Bus run in its own session. --- Makefile.am | 4 ++++ configure.ac | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Makefile.am b/Makefile.am index a9373e643..9e946488c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -419,6 +419,10 @@ endif TESTS = $(unit_tests) AM_TESTS_ENVIRONMENT = MALLOC_CHECK_=3 MALLOC_PERTURB_=69 +if DBUS_RUN_SESSION +AM_TESTS_ENVIRONMENT += dbus-run-session -- +endif + pkgconfigdir = $(libdir)/pkgconfig if LIBRARY diff --git a/configure.ac b/configure.ac index 1016ee4ee..d63265747 100644 --- a/configure.ac +++ b/configure.ac @@ -34,8 +34,10 @@ AC_PROG_LIBTOOL if (test "$USE_MAINTAINER_MODE" = "yes"); then AC_CHECK_PROG(enable_coverage, [lcov], [yes], [no]) + AC_CHECK_PROG(enable_dbus_run_session, [dbus-run-session], [yes]) fi AM_CONDITIONAL(COVERAGE, test "${enable_coverage}" = "yes") +AM_CONDITIONAL(DBUS_RUN_SESSION, test "${enable_dbus_run_session}" = "yes") MISC_FLAGS -- 2.47.3