Commit a9e25f06 authored by Ralf Habacker's avatar Ralf Habacker

Use prefined variables to setup environment in cmake macro add_test_executable

Bug: #135
parent b1cba7b1
......@@ -485,6 +485,9 @@ 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}${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${IDE_BIN})
set(DBUS_TEST_DATA ${Z_DRIVE_IF_WINE}${CMAKE_BINARY_DIR}/test/data)
set(DBUS_TEST_DAEMON ${Z_DRIVE_IF_WINE}${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/dbus-daemon${EXEEXT})
set(DBUS_TEST_DBUS_LAUNCH ${Z_DRIVE_IF_WINE}${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/dbus-launch${EXEEXT})
set(DBUS_TEST_HOMEDIR ${Z_DRIVE_IF_WINE}${CMAKE_BINARY_DIR}/dbus)
set(TEST_LAUNCH_HELPER_BINARY ${Z_DRIVE_IF_WINE}${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/dbus-daemon-launch-helper-test${EXEEXT})
if (UNIX)
set(TEST_SOCKET_DIR ${DBUS_SESSION_SOCKET_DIR})
......
......@@ -59,11 +59,11 @@ macro(add_test_executable _target _source)
set(_env)
list(APPEND _env "DBUS_SESSION_BUS_ADDRESS=")
list(APPEND _env "DBUS_FATAL_WARNINGS=1")
list(APPEND _env "DBUS_TEST_DAEMON=${Z_DRIVE_IF_WINE}${CMAKE_BINARY_DIR}/bin/dbus-daemon${EXEEXT}")
list(APPEND _env "DBUS_TEST_DATA=${Z_DRIVE_IF_WINE}${CMAKE_BINARY_DIR}/test/data")
list(APPEND _env "DBUS_TEST_DBUS_LAUNCH=${Z_DRIVE_IF_WINE}${CMAKE_BINARY_DIR}/bin/dbus-launch${EXEEXT}")
list(APPEND _env "DBUS_TEST_DAEMON=${DBUS_TEST_DAEMON}")
list(APPEND _env "DBUS_TEST_DATA=${DBUS_TEST_DATA}")
list(APPEND _env "DBUS_TEST_DBUS_LAUNCH=${DBUS_TEST_DBUS_LAUNCH}")
list(APPEND _env "DBUS_TEST_EXEC=${DBUS_TEST_EXEC}")
list(APPEND _env "DBUS_TEST_HOMEDIR=${Z_DRIVE_IF_WINE}${CMAKE_BINARY_DIR}/dbus")
list(APPEND _env "DBUS_TEST_HOMEDIR=${DBUS_TEST_HOMEDIR}")
list(APPEND _env "DBUS_TEST_UNINSTALLED=1")
set_tests_properties(${_target} PROPERTIES ENVIRONMENT "${_env}")
endmacro(add_test_executable)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment