Add build system variable DBUS_NAME_TEST_EXEC to cover differences in executable paths

Autotools creates executable applications in the respective
subdirectory of the build directory, while cmake creates
them in <build-root>/bin.

This leads to different paths in the file created
from org.freedesktop.DBus.TestSuite.PrivServer.service.in,
which are fixed by the new variable.

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/135
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Ralf Habacker 2018-11-20 16:33:57 +01:00 committed by Simon McVittie
parent a7d1e275e7
commit d9de6ab213
4 changed files with 6 additions and 1 deletions

View file

@ -483,6 +483,7 @@ add_definitions(${DBUS_BUS_CFLAGS})
if (DBUS_BUILD_TESTS)
# set variables used for the .in files (substituted by configure_file) in test/data:
set(DBUS_TEST_EXEC ${Z_DRIVE_IF_WINE}${EXECUTABLE_OUTPUT_PATH}${IDE_BIN})
set(DBUS_NAME_TEST_EXEC ${DBUS_TEST_EXEC})
set(DBUS_TEST_DATA ${Z_DRIVE_IF_WINE}${CMAKE_BINARY_DIR}/test/data)
set(TEST_LAUNCH_HELPER_BINARY ${Z_DRIVE_IF_WINE}${EXECUTABLE_OUTPUT_PATH}/dbus-daemon-launch-helper-test)
if (UNIX)

View file

@ -1553,10 +1553,12 @@ AC_ARG_WITH(dbus-test-dir, AS_HELP_STRING([--with-dbus-test-dir=[dirname]],[path
DBUS_PWD=$withval)
DBUS_TEST_EXEC="$DBUS_PWD/test"
DBUS_NAME_TEST_EXEC="$DBUS_PWD/test/name-test"
DBUS_TEST_DATA="$DBUS_PWD/test/data"
AC_SUBST([DBUS_TEST_DATA])
AC_SUBST([DBUS_TEST_EXEC])
AC_SUBST([DBUS_NAME_TEST_EXEC])
AC_DEFINE_UNQUOTED([DBUS_EXEEXT], ["$EXEEXT"],
[Extension for executables, typically empty or .exe])

View file

@ -611,6 +611,7 @@ uninstalled-config-local:
sed \
-e 's,[@]DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL[@],$(DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL),' \
-e 's,[@]DBUS_SESSION_BUS_LISTEN_ADDRESS[@],$(DBUS_SESSION_BUS_LISTEN_ADDRESS),' \
-e 's,[@]DBUS_NAME_TEST_EXEC[@],$(DBUS_NAME_TEST_EXEC),' \
-e 's,[@]DBUS_TEST_DATA[@],@abs_builddir@/data,' \
-e 's,[@]DBUS_TEST_EXEC[@],@abs_builddir@,' \
-e 's,[@]DBUS_USER[@],$(DBUS_USER),' \
@ -628,6 +629,7 @@ if DBUS_ENABLE_INSTALLED_TESTS
sed \
-e 's,[@]DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL[@],$(DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL),' \
-e 's,[@]DBUS_SESSION_BUS_LISTEN_ADDRESS[@],$(DBUS_SESSION_BUS_LISTEN_ADDRESS),' \
-e 's,[@]DBUS_NAME_TEST_EXEC[@],$(DBUS_NAME_TEST_EXEC),' \
-e 's,[@]DBUS_TEST_DATA[@],$(testexecdir)/data,' \
-e 's,[@]DBUS_TEST_EXEC[@],$(testexecdir),' \
-e 's,[@]DBUS_USER[@],$(DBUS_USER),' \

View file

@ -1,4 +1,4 @@
[D-BUS Service]
Name=org.freedesktop.DBus.TestSuite.PrivServer
Exec=@DBUS_TEST_EXEC@/name-test/test-privserver@EXEEXT@
Exec=@DBUS_NAME_TEST_EXEC@/test-privserver@EXEEXT@