From: Simon McVittie Date: Wed, 5 Jul 2017 14:28:08 +0000 (+0100) Subject: name-test: Backport dbus-run-session wrapper from git master X-Git-Tag: dbus-1.12.0~47^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b2fbffb02728e9557e37e6f2792bb8d548971952;p=platform%2Fupstream%2Fdbus.git name-test: Backport dbus-run-session wrapper from git master test-pending-call-disconnected relies on being run under a session bus. On master, the TESTS in this directory all get that treatment, but in dbus-1.10 they do not. This caused test-pending-call-disconnected to fail in minimal environments like travis-ci where there is no developer-initiated session bus. Backport part of commit ec6b220 "name-test: run most C tests directly, not via run-test.sh" to wrap it in dbus-run-session. This is better than putting it in run-test.sh because this way, its TAP output is parsed directly by Automake. It also has the side benefit of exercising dbus-run-session in the automated tests. Signed-off-by: Simon McVittie Reviewed-by: Philip Withnall Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101698 --- diff --git a/test/name-test/Makefile.am b/test/name-test/Makefile.am index 9982e45..8ec9de8 100644 --- a/test/name-test/Makefile.am +++ b/test/name-test/Makefile.am @@ -9,7 +9,15 @@ AM_LDFLAGS = @R_DYNAMIC_LDFLAG@ TEST_EXTENSIONS = .sh -SH_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/build-aux/tap-driver.sh +LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/build-aux/tap-driver.sh +SH_LOG_DRIVER = $(LOG_DRIVER) + +LOG_COMPILER = \ + @abs_top_builddir@/tools/dbus-run-session$(EXEEXT) \ + --config-file=@abs_builddir@/uninstalled-session.conf \ + --dbus-daemon=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \ + -- \ + $(NULL) SH_LOG_COMPILER = $(SHELL) ## note that TESTS has special meaning (stuff to use in make check) @@ -22,12 +30,24 @@ if DBUS_UNIX AM_TESTS_ENVIRONMENT = \ export DBUS_TOP_BUILDDIR=@abs_top_builddir@; \ export DBUS_TOP_SRCDIR=@abs_top_srcdir@; \ + export PATH="@abs_top_builddir@/bus:$$PATH"; \ export PYTHON=@PYTHON@; \ export DBUS_TEST_DATA=@abs_top_builddir@/test/data; \ export DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT); \ export XDG_RUNTIME_DIR=@abs_top_builddir@/test/XDG_RUNTIME_DIR; \ + unset DBUS_SESSION_BUS_ADDRESS; \ + unset DBUS_SESSION_BUS_PID; \ $(NULL) +uninstalled-session.conf: $(top_builddir)/bus/session.conf Makefile + $(SED) -e 's|@abs_top_builddir@/test/data/valid-service-files|g' \ + -e 's| $@ + +check_DATA = \ + uninstalled-session.conf \ + $(NULL) + TESTS += \ run-test.sh \ run-test-systemserver.sh \