From c2de0d98ba39e0a1a970d066fd19be786092f376 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Tue, 1 Mar 2016 16:55:22 +0100 Subject: Imported Upstream version 1.1.91 --- tools/Makefile.am | 1 + tools/Makefile.in | 1 + tools/run-test-dbus-session.sh | 10 ++++++++++ tools/run-test-valgrind.sh | 11 ++++++++--- 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100755 tools/run-test-dbus-session.sh (limited to 'tools') diff --git a/tools/Makefile.am b/tools/Makefile.am index f008956d..27d6bcc4 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -3,5 +3,6 @@ EXTRA_DIST = \ debug-helper.py \ doc-generator.xsl \ run-test-valgrind.sh \ + run-test-dbus-session.sh \ test-networkmanager-service.py \ test-sudo-wrapper.sh diff --git a/tools/Makefile.in b/tools/Makefile.in index 0c4078a3..585a0503 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -399,6 +399,7 @@ EXTRA_DIST = \ debug-helper.py \ doc-generator.xsl \ run-test-valgrind.sh \ + run-test-dbus-session.sh \ test-networkmanager-service.py \ test-sudo-wrapper.sh diff --git a/tools/run-test-dbus-session.sh b/tools/run-test-dbus-session.sh new file mode 100755 index 00000000..0235d65b --- /dev/null +++ b/tools/run-test-dbus-session.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +if ! which dbus-run-session &>/dev/null; then + eval `dbus-launch --sh-syntax` + trap "kill $DBUS_SESSION_BUS_PID" EXIT + "$@" + exit $? +fi + +dbus-run-session -- "$@" 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 \ -- cgit 1.3.0-6-gf8a5