if (DBUS_BUILD_TESTS)
# set variables used for the .in files (substituted by configure_file) in test/data:
- set(TEST_VALID_SERVICE_DIR ${CMAKE_BINARY_DIR}/test/data/valid-service-files)
- set(TEST_VALID_SERVICE_SYSTEM_DIR ${CMAKE_BINARY_DIR}/test/data/valid-service-files-system)
- set(TEST_INVALID_SERVICE_SYSTEM_DIR ${CMAKE_BINARY_DIR}/test/data/invalid-service-files-system)
+ 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_PRIVSERVER_BINARY ${EXECUTABLE_OUTPUT_PATH}/test-privserver)
# Useful in a cross-compilation environment, where the tests are run on the host system.
AC_ARG_WITH(dbus-test-dir, AS_HELP_STRING([--with-dbus-test-dir=[dirname]],[path where the tests tools are available]),
DBUS_PWD=$withval)
-AC_DEFUN([TEST_PATH], [
-TEST_$1=${DBUS_PWD}/test/$2
-AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1",
- [Full path to test file test/$2 in builddir])
-AC_SUBST(TEST_$1)
-])
AC_DEFUN([TEST_PROG], [
TEST_$1=${DBUS_PWD}/test/$2
AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1$EXEEXT",
AC_SUBST(TEST_$1)
])
-TEST_PATH(VALID_SERVICE_DIR, data/valid-service-files)
-TEST_PATH(INVALID_SERVICE_DIR, data/invalid-service-files)
-TEST_PATH(VALID_SERVICE_SYSTEM_DIR, data/valid-service-files-system)
-TEST_PATH(INVALID_SERVICE_SYSTEM_DIR, data/invalid-service-files-system)
+DBUS_TEST_DATA="$DBUS_PWD/test/data"
+AC_SUBST([DBUS_TEST_DATA])
+
TEST_PROG(SERVICE_BINARY, test-service)
TEST_PROG(SHELL_SERVICE_BINARY, test-shell-service)
TEST_PROG(EXIT_BINARY, test-exit)
<listen>@TEST_LISTEN@</listen>
<type>system</type>
<servicehelper>@TEST_LAUNCH_HELPER_BINARY@</servicehelper>
- <servicedir>@TEST_INVALID_SERVICE_SYSTEM_DIR@</servicedir>
+ <servicedir>@DBUS_TEST_DATA@/invalid-service-files-system</servicedir>
<policy context="default">
<allow send_interface="*"/>
<allow receive_interface="*"/>
<listen>unix:tmpdir=@TEST_SOCKET_DIR@</listen>
<type>system</type>
<servicehelper>@TEST_LAUNCH_HELPER_BINARY@</servicehelper>
- <servicedir>@TEST_INVALID_SERVICE_SYSTEM_DIR@</servicedir>
+ <servicedir>@DBUS_TEST_DATA@/invalid-service-files-system</servicedir>
<policy context="default">
<allow send_interface="*"/>
<allow receive_interface="*"/>
<listen>@TEST_LISTEN@</listen>
<type>system</type>
<servicehelper>@TEST_LAUNCH_HELPER_BINARY@</servicehelper>
- <servicedir>@TEST_VALID_SERVICE_SYSTEM_DIR@</servicedir>
+ <servicedir>@DBUS_TEST_DATA@/valid-service-files-system</servicedir>
<policy context="default">
<allow send_interface="*"/>
<allow receive_interface="*"/>
<listen>unix:tmpdir=@TEST_SOCKET_DIR@</listen>
<type>system</type>
<servicehelper>@TEST_LAUNCH_HELPER_BINARY@</servicehelper>
- <servicedir>@TEST_VALID_SERVICE_SYSTEM_DIR@</servicedir>
+ <servicedir>@DBUS_TEST_DATA@/valid-service-files-system</servicedir>
<policy context="default">
<allow send_interface="*"/>
<allow receive_interface="*"/>
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<listen>@TEST_LISTEN@</listen>
- <servicedir>@TEST_VALID_SERVICE_DIR@</servicedir>
+ <servicedir>@DBUS_TEST_DATA@/valid-service-files</servicedir>
<auth>DBUS_COOKIE_SHA1</auth>
<policy context="default">
<allow send_interface="*"/>
<busconfig>
<listen>debug-pipe:name=test-server</listen>
<listen>unix:tmpdir=@TEST_SOCKET_DIR@</listen>
- <servicedir>@TEST_VALID_SERVICE_DIR@</servicedir>
+ <servicedir>@DBUS_TEST_DATA@/valid-service-files</servicedir>
<auth>DBUS_COOKIE_SHA1</auth>
<policy context="default">
<allow send_interface="*"/>
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<listen>@TEST_LISTEN@</listen>
- <servicedir>@TEST_VALID_SERVICE_DIR@</servicedir>
+ <servicedir>@DBUS_TEST_DATA@/valid-service-files</servicedir>
<policy context="default">
<allow send_interface="*"/>
<allow receive_interface="*"/>
<busconfig>
<listen>debug-pipe:name=test-server</listen>
<listen>unix:tmpdir=@TEST_SOCKET_DIR@</listen>
- <servicedir>@TEST_VALID_SERVICE_DIR@</servicedir>
+ <servicedir>@DBUS_TEST_DATA@/valid-service-files</servicedir>
<policy context="default">
<allow send_interface="*"/>
<allow receive_interface="*"/>