summary refs log tree commit diff
path: root/tools/run-test-valgrind.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/run-test-valgrind.sh')
-rwxr-xr-xtools/run-test-valgrind.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/run-test-valgrind.sh b/tools/run-test-valgrind.sh
index 4dc092a0..f2eeefcd 100755
--- a/tools/run-test-valgrind.sh
+++ b/tools/run-test-valgrind.sh
@@ -80,10 +80,14 @@ else
     fi
 fi
 
+NMTST_DBUS_RUN_SESSION=()
 if [ "$NMTST_LAUNCH_DBUS" == "yes" ]; then
-    # Spawn DBus
-    eval `dbus-launch --sh-syntax`
-    trap "kill $DBUS_SESSION_BUS_PID" EXIT
+    if ! which dbus-run-session &>/dev/null ; then
+        eval `dbus-launch --sh-syntax`
+        trap "kill $DBUS_SESSION_BUS_PID" EXIT
+    else
+        NMTST_DBUS_RUN_SESSION=(dbus-run-session --)
+    fi
 fi
 
 if [ "$NMTST_NO_VALGRIND" != "" ]; then
@@ -95,6 +99,7 @@ LOGFILE="${TEST}.valgrind-log"
 
 export G_SLICE=always-malloc
 export G_DEBUG=gc-friendly
+"${NMTST_DBUS_RUN_SESSION[@]}" \
 "${NMTST_LIBTOOL[@]}" "$NMTST_VALGRIND" \
 	--quiet \
 	--error-exitcode=$VALGRIND_ERROR \