libtest: replace dbus-launch with dbus-daemon

dbus-launch is X11-specific and contains a lot of legacy code to
support X11 autolaunching. It should not be part of the Wayland
(and/or Mir) future.

Start a dbus-daemon directly instead.
tingping/wmclass
Simon McVittie 2016-07-27 23:23:11 +01:00
parent 07b342a937
commit 6cc8062cfb
1 changed files with 8 additions and 1 deletions

View File

@ -231,7 +231,14 @@ skip_without_bwrap () {
}
sed s#@testdir@#${test_builddir}# ${test_srcdir}/session.conf.in > session.conf
eval `dbus-launch --config-file=session.conf --sh-syntax`
dbus-daemon --fork --config-file=session.conf --print-address=3 --print-pid=4 \
3> dbus-session-bus-address 4> dbus-session-bus-pid
export DBUS_SESSION_BUS_ADDRESS="$(cat dbus-session-bus-address)"
DBUS_SESSION_BUS_PID="$(cat dbus-session-bus-pid)"
if ! /bin/kill -0 "$DBUS_SESSION_BUS_PID"; then
assert_not_reached "Failed to start dbus-daemon"
fi
cleanup () {
/bin/kill $DBUS_SESSION_BUS_PID