diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2016-02-08 20:09:58 +0000 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2016-02-11 02:37:11 +0100 |
commit | 8fd2be6013e3d0ff6a6ff63ea022f9606d9a87c6 (patch) | |
tree | 8f21972f180dad94f96965bcfddf784b2e176a0a | |
parent | b065413b0e9684fc991bf528fa6ab7175bb04888 (diff) | |
download | dbus-8fd2be6013e3d0ff6a6ff63ea022f9606d9a87c6.tar.gz |
Replace $DBUS_USE_TEST_BINARY with $DBUS_TEST_DBUS_LAUNCH
Instead of using $DBUS_USE_TEST_BINARY to control whether to use the
hard-coded test binary TEST_BUS_LAUNCH_BINARY, we can just use
$DBUS_TEST_DBUS_LAUNCH to control what we launch directly, as we
were already doing for $DBUS_TEST_DAEMON.
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
-rw-r--r-- | cmake/CMakeLists.txt | 1 | ||||
-rw-r--r-- | cmake/config.h.cmake | 1 | ||||
-rw-r--r-- | cmake/modules/Macros.cmake | 1 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | dbus/dbus-sysdeps-unix.c | 8 | ||||
-rw-r--r-- | test/Makefile.am | 2 | ||||
-rw-r--r-- | test/name-test/Makefile.am | 1 | ||||
-rw-r--r-- | tools/dbus-launch.c | 6 | ||||
-rwxr-xr-x | tools/run-with-tmp-session-bus.sh | 5 |
9 files changed, 11 insertions, 17 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 4db9c67a..13332503 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -506,7 +506,6 @@ if (DBUS_BUILD_TESTS) set(DBUS_TEST_DATA ${CMAKE_BINARY_DIR}/test/data) set(TEST_SOCKET_DIR ${DBUS_SESSION_SOCKET_DIR} ) set(TEST_LAUNCH_HELPER_BINARY ${EXECUTABLE_OUTPUT_PATH}/dbus-daemon-launch-helper-test) - set(TEST_BUS_LAUNCH_BINARY ${EXECUTABLE_OUTPUT_PATH}/dbus-launch${EXEEXT}) if (UNIX) set (TEST_LISTEN "unix:tmpdir=${TEST_SOCKET_DIR}") endif (UNIX) diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake index d2af3c96..c4983623 100644 --- a/cmake/config.h.cmake +++ b/cmake/config.h.cmake @@ -33,7 +33,6 @@ // test binaries #define DBUS_TEST_EXEC "@DBUS_TEST_EXEC@" #define DBUS_EXEEXT "@EXEEXT@" -#cmakedefine TEST_BUS_LAUNCH_BINARY "@TEST_BUS_LAUNCH_BINARY@" /* Some dbus features */ #cmakedefine DBUS_ENABLE_ANSI 1 diff --git a/cmake/modules/Macros.cmake b/cmake/modules/Macros.cmake index fd3f62c4..8e0278a4 100644 --- a/cmake/modules/Macros.cmake +++ b/cmake/modules/Macros.cmake @@ -52,6 +52,7 @@ macro(add_test_executable _target _source) list(APPEND _env "DBUS_SESSION_BUS_ADDRESS=") list(APPEND _env "DBUS_FATAL_WARNINGS=1") list(APPEND _env "DBUS_TEST_DATA=${PREFIX}${CMAKE_BINARY_DIR}/test/data") + list(APPEND _env "DBUS_TEST_DBUS_LAUNCH=${PREFIX}${CMAKE_BINARY_DIR}/bin/dbus-launch${EXEEXT}") list(APPEND _env "DBUS_TEST_HOMEDIR=${PREFIX}${CMAKE_BINARY_DIR}/dbus") set_tests_properties(${_target} PROPERTIES ENVIRONMENT "${_env}") endmacro(add_test_executable) diff --git a/configure.ac b/configure.ac index 5e883435..a734a3b6 100644 --- a/configure.ac +++ b/configure.ac @@ -1731,9 +1731,6 @@ AC_DEFINE_UNQUOTED([DBUS_TEST_EXEC], ["$DBUS_TEST_EXEC"], AC_DEFINE_UNQUOTED([DBUS_EXEEXT], ["$EXEEXT"], [Extension for executables, typically empty or .exe]) -AC_DEFINE_UNQUOTED(TEST_BUS_LAUNCH_BINARY, ["$DBUS_PWD/tools/dbus-launch$EXEEXT"], - [Full path to the dbus-launch in the builddir]) - ## Export the non-setuid external helper TEST_LAUNCH_HELPER_BINARY="$DBUS_PWD/bus/dbus-daemon-launch-helper-test$EXEEXT" AC_SUBST(TEST_LAUNCH_HELPER_BINARY) diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index 50ca60a2..f0fca85e 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -3671,7 +3671,7 @@ _dbus_get_autolaunch_address (const char *scope, * but that's done elsewhere, and if it worked, this function wouldn't * be called.) */ const char *display; - char *progpath; + const char *progpath; char *argv[6]; int i; DBusString uuid; @@ -3716,9 +3716,9 @@ _dbus_get_autolaunch_address (const char *scope, } #ifdef DBUS_ENABLE_EMBEDDED_TESTS - if (_dbus_getenv ("DBUS_USE_TEST_BINARY") != NULL) - progpath = TEST_BUS_LAUNCH_BINARY; - else + progpath = _dbus_getenv ("DBUS_TEST_DBUS_LAUNCH"); + + if (progpath == NULL) #endif progpath = DBUS_BINDIR "/dbus-launch"; /* diff --git a/test/Makefile.am b/test/Makefile.am index b7f40bb0..1438995c 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -174,6 +174,7 @@ installcheck_tests = installcheck_environment = \ export XDG_RUNTIME_DIR=@abs_top_builddir@/test/XDG_RUNTIME_DIR; \ export DBUS_TEST_DAEMON=$(DESTDIR)$(DBUS_DAEMONDIR)/dbus-daemon$(EXEEXT); \ + export DBUS_TEST_DBUS_LAUNCH=$(DESTDIR)$(bindir)/dbus-launch$(EXEEXT); \ export DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus; \ export DBUS_TEST_DATADIR=$(DESTDIR)$(datadir); \ ${NULL} @@ -182,6 +183,7 @@ AM_TESTS_ENVIRONMENT = \ export XDG_RUNTIME_DIR=@abs_top_builddir@/test/XDG_RUNTIME_DIR; \ export DBUS_FATAL_WARNINGS=1; \ export DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT); \ + export DBUS_TEST_DBUS_LAUNCH=@abs_top_builddir@/tools/dbus-launch$(EXEEXT); \ export DBUS_TEST_DATA=@abs_top_builddir@/test/data; \ export DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus; \ $(NULL) diff --git a/test/name-test/Makefile.am b/test/name-test/Makefile.am index 3b7fcc62..fae28920 100644 --- a/test/name-test/Makefile.am +++ b/test/name-test/Makefile.am @@ -25,6 +25,7 @@ AM_TESTS_ENVIRONMENT = \ export PYTHON=@PYTHON@; \ export DBUS_TEST_DATA=@abs_top_builddir@/test/data; \ export DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT); \ + export DBUS_TEST_DBUS_LAUNCH=@abs_top_builddir@/tools/dbus-launch$(EXEEXT); \ export XDG_RUNTIME_DIR=@abs_top_builddir@/test/XDG_RUNTIME_DIR; \ $(NULL) diff --git a/tools/dbus-launch.c b/tools/dbus-launch.c index 0f1e6ede..1b655027 100644 --- a/tools/dbus-launch.c +++ b/tools/dbus-launch.c @@ -1169,10 +1169,10 @@ main (int argc, char **argv) #ifdef DBUS_ENABLE_EMBEDDED_TESTS { - const char *test_daemon; /* exec from testdir */ - if (getenv ("DBUS_USE_TEST_BINARY") != NULL && - (test_daemon = getenv ("DBUS_TEST_DAEMON")) != NULL) + const char *test_daemon = getenv ("DBUS_TEST_DAEMON"); + + if (test_daemon != NULL) { if (config_file == NULL && getenv ("DBUS_TEST_DATA") != NULL) { diff --git a/tools/run-with-tmp-session-bus.sh b/tools/run-with-tmp-session-bus.sh index 94ae8fc8..688f9e48 100755 --- a/tools/run-with-tmp-session-bus.sh +++ b/tools/run-with-tmp-session-bus.sh @@ -45,11 +45,6 @@ export LD_LIBRARY_PATH unset DBUS_SESSION_BUS_ADDRESS unset DBUS_SESSION_BUS_PID -# this does not actually affect dbus-run-session any more, but could be -# significant for dbus-launch as used by the autolaunch test -DBUS_USE_TEST_BINARY=1 -export DBUS_USE_TEST_BINARY - $DBUS_TOP_BUILDDIR/tools/dbus-run-session \ --config-file="$CONFIG_FILE" \ --dbus-daemon="$DBUS_TOP_BUILDDIR/bus/dbus-daemon" \ |