Commit 1099536c authored by pvuorela's avatar pvuorela

Merge branch 'mer-test-dbus-session' into 'master'

Tests: launch a temporary D-Bus session

See merge request mer-core/qtcontacts-sqlite!21
parents 4ac7b579 ed11b9e2
......@@ -12,6 +12,6 @@ INCLUDEPATH += $$PWD/../src/extensions
target.path = /opt/tests/qtcontacts-sqlite-qt5
INSTALLS += target
check.commands = "LC_ALL=C QT_PLUGIN_PATH=$$shadowed($${PWD})/../src/engine/ ./$${TARGET}"
check.commands = "$${PWD}/ $$shadowed($${PWD})/.. ./$${TARGET}"
check.depends = $${TARGET}
#! /bin/sh
# Usage:
# Run TEST_PROGRAM within a proper environment; this includes a D-Bus session
# and any environment variable needed for the succesful completion of the test.
# If the TEST_WRAPPER environment variable is set, then it will be executed and
# the test program will be passed as an argument to it; this can be useful, for
# example, to run the tests in valgrind or strace.
set -e
export LC_ALL=C
export QT_PLUGIN_PATH="${TOP_BUILD_DIR}/src/engine/"
OUTPUT=$(dbus-daemon --session --print-address '' --print-pid '' --fork)
export DBUS_SESSION_BUS_ADDRESS=$(echo "$OUTPUT" | head -1)
DBUS_DAEMON_PID=$(echo "$OUTPUT" | tail -1)
cleanUp() {
echo "Killing the temporary D-Bus daemon"
trap cleanUp EXIT INT TERM
trap - EXIT
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