summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-18 13:03:56 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-18 14:03:11 +0000
commitff131236b1a6df539f219480617f44ff07f5a47b (patch)
tree82181813b1f8ee9f6b8c407a4283006be90d150e
parent2fb2fc0da1afb9fe1cde4183eb5512124734232b (diff)
downloadtelepathy-glib-ff131236b1a6df539f219480617f44ff07f5a47b.tar.gz
logger tests: rely on GTestDBus instead of with-session-bus.sh
Reviewed-by: Guillaume Desmottes
-rw-r--r--tests/logger/dbus/Makefile.am21
-rw-r--r--tests/logger/dbus/dbus-1/session.conf.in30
-rw-r--r--tools/Makefile.am2
-rwxr-xr-xtools/with-session-bus.sh106
4 files changed, 3 insertions, 156 deletions
diff --git a/tests/logger/dbus/Makefile.am b/tests/logger/dbus/Makefile.am
index 2cda6b673..59c81e37a 100644
--- a/tests/logger/dbus/Makefile.am
+++ b/tests/logger/dbus/Makefile.am
@@ -49,11 +49,9 @@ AM_TESTS_ENVIRONMENT = \
G_SLICE=debug-blocks \
TPL_DEBUG=all \
G_DEBUG=fatal_warnings,fatal_criticals$(maybe_gc_friendly) \
- $(NULL)
-
-LOG_COMPILER = \
- sh $(top_srcdir)/tools/with-session-bus.sh \
- --config-file=dbus-1/session.conf -- \
+ DBUS_SESSION_BUS_ADDRESS=this-is-clearly-not-valid \
+ DBUS_STARTER_ADDRESS=this-is-clearly-not-valid \
+ DBUS_STARTER_BUS_TYPE=this-is-clearly-not-valid \
$(NULL)
check-valgrind:
@@ -64,26 +62,13 @@ check-valgrind:
include $(top_srcdir)/tools/valgrind.mk
VALGRIND_LOG_COMPILER = \
- $(LOG_COMPILER) \
env G_SLICE=always-malloc CHECK_VERBOSE=1 \
$(top_builddir)/libtool --mode=execute \
$(VALGRIND) --suppressions=$(top_srcdir)/tests/suppressions/tpl.supp $(VALGRIND_FLAGS) \
$(NULL)
-BUILT_SOURCES = \
- dbus-1/session.conf \
- $(NULL)
-
CLEANFILES = $(BUILT_SOURCES)
distclean-local:
rm -f capture-*.log
rm -rf _gen
-
-EXTRA_DIST = \
- dbus-1/session.conf.in \
- $(NULL)
-
-dbus-1/%.conf: $(srcdir)/dbus-1/%.conf.in
- $(AM_V_at)$(MKDIR_P) dbus-1
- $(AM_V_GEN)sed -e "s|[@]abs_top_builddir[@]|@abs_top_builddir@|g" $< > $@
diff --git a/tests/logger/dbus/dbus-1/session.conf.in b/tests/logger/dbus/dbus-1/session.conf.in
deleted file mode 100644
index b934b1d3c..000000000
--- a/tests/logger/dbus/dbus-1/session.conf.in
+++ /dev/null
@@ -1,30 +0,0 @@
-<!-- Copied from telepathy-gabble (which doubtless copied it from somewhere
- else) and modified.
- This configuration file controls the per-user-login-session message bus.
- Add a session-local.conf and edit that rather than changing this
- file directly. -->
-
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <!-- Our well-known bus type, don't change this -->
- <type>session</type>
-
- <listen>unix:tmpdir=/tmp</listen>
-
- <servicedir>@abs_top_builddir@/tests/dbus/dbus-1/services/</servicedir>
-
- <policy context="default">
- <!-- Allow everything to be sent -->
- <allow send_destination="*" eavesdrop="true"/>
- <!-- Allow everything to be received -->
- <allow eavesdrop="true"/>
- <!-- Allow anyone to own anything -->
- <allow own="*"/>
- </policy>
-
- <!-- This is included last so local configuration can override what's
- in this standard file -->
-
-
-</busconfig>
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 761ee03c3..0fd42f89c 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -9,7 +9,6 @@ telepathy-glib-env: telepathy-glib-env.in Makefile
if ENABLE_INSTALLED_TESTS
toolsdir = @tpglibtestsdir@/tools
tools_SCRIPTS = \
- with-session-bus.sh \
test-wrapper.sh \
libglibcodegen.py \
libtpcodegen.py \
@@ -44,7 +43,6 @@ EXTRA_DIST = \
telepathy-glib.supp \
telepathy-glib-env.in \
test-wrapper.sh \
- with-session-bus.sh \
xincludator.py
CLEANFILES = libtpcodegen.pyc libtpcodegen.pyo libglibcodegen.pyc libglibcodegen.pyo $(noinst_SCRIPTS)
diff --git a/tools/with-session-bus.sh b/tools/with-session-bus.sh
deleted file mode 100755
index 0afa59321..000000000
--- a/tools/with-session-bus.sh
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-# with-session-bus.sh - run a program with a temporary D-Bus session daemon
-#
-# The canonical location of this program is the telepathy-glib tools/
-# directory, please synchronize any changes with that copy.
-#
-# Copyright (C) 2007-2008 Collabora Ltd. <http://www.collabora.co.uk/>
-#
-# Copying and distribution of this file, with or without modification,
-# are permitted in any medium without royalty provided the copyright
-# notice and this notice are preserved.
-
-set -e
-
-me=with-session-bus
-
-dbus_daemon_args="--print-address=5 --print-pid=6 --fork"
-sleep=0
-
-usage ()
-{
- echo "usage: $me [options] -- program [program_options]" >&2
- echo "Requires write access to the current directory." >&2
- echo "" >&2
- echo "If \$WITH_SESSION_BUS_FORK_DBUS_MONITOR is set, fork dbus-monitor" >&2
- echo "with the arguments in \$WITH_SESSION_BUS_FORK_DBUS_MONITOR_OPT." >&2
- echo "The output of dbus-monitor is saved in $me-<pid>.dbus-monitor-logs" >&2
- exit 2
-}
-
-while test "z$1" != "z--"; do
- case "$1" in
- --sleep=*)
- sleep="$1"
- sleep="${sleep#--sleep=}"
- shift
- ;;
- --session)
- dbus_daemon_args="$dbus_daemon_args --session"
- shift
- ;;
- --config-file=*)
- # FIXME: assumes config file doesn't contain any special characters
- dbus_daemon_args="$dbus_daemon_args $1"
- shift
- ;;
- *)
- usage
- ;;
- esac
-done
-shift
-if test "z$1" = "z"; then usage; fi
-
-exec 5> $me-$$.address
-exec 6> $me-$$.pid
-
-cleanup ()
-{
- pid=`head -n1 $me-$$.pid`
- if test -n "$pid" ; then
- if [ -n "$VERBOSE_TESTS" ]; then
- echo "Killing temporary bus daemon: $pid" >&2
- fi
- kill -INT "$pid"
- fi
- rm -f $me-$$.address
- rm -f $me-$$.pid
-}
-
-trap cleanup INT HUP TERM
-dbus-daemon $dbus_daemon_args
-
-if [ -n "$VERBOSE_TESTS" ]; then
- { echo -n "Temporary bus daemon is "; cat $me-$$.address; } >&2
- { echo -n "Temporary bus daemon PID is "; head -n1 $me-$$.pid; } >&2
-fi
-
-e=0
-
-# These might be non-null when run from e.g. gnome-terminal 3.8, which uses
-# an activatable service for its windows; we don't want to inherit them either
-unset DBUS_STARTER_ADDRESS
-unset DBUS_STARTER_BUS_TYPE
-
-DBUS_SESSION_BUS_ADDRESS="`cat $me-$$.address`"
-export DBUS_SESSION_BUS_ADDRESS
-DBUS_SESSION_BUS_PID="`cat $me-$$.pid`"
-export DBUS_SESSION_BUS_PID
-
-if [ -n "$WITH_SESSION_BUS_FORK_DBUS_MONITOR" ] ; then
- echo -n "Forking dbus-monitor $WITH_SESSION_BUS_FORK_DBUS_MONITOR_OPT" >&2
- dbus-monitor $WITH_SESSION_BUS_FORK_DBUS_MONITOR_OPT \
- > $me-$$.dbus-monitor-logs 2>&1 &
-fi
-
-"$@" || e=$?
-
-if test $sleep != 0; then
- sleep $sleep
-fi
-
-trap - INT HUP TERM
-cleanup
-
-exit $e