17
17
# Author: Juhapekka Piiroinen <juhapekka.piiroinen@canonical.com>
18
18
################################################################################
20
. `dirname $0`/../../build_paths.inc
27
_TARGET=$(basename $1)
28
_TESTFILE=$(basename $2)
29
_IMPORT_PATH="${BUILD_DIR}/modules:$QML2_IMPORT_PATH"
30
_THEMES_PATH="${BUILD_DIR}/modules"
31
_XML="${BUILD_DIR}/tests/test_$_TARGET_$_TESTFILE.xml"
24
_XML="../../test_$_TARGET_$_TESTFILE.xml"
33
25
_ARGS="-p -o -p $_XML,xunitxml -p -o -p -,txt"
37
28
function create_test_cmd {
38
if [[ "$_TARGETPATH" = /* ]]; then
39
_CMD="dbus-test-runner --task $_TARGETPATH -n $_TESTFILE -m 300"
41
_CMD="dbus-test-runner --task ./$_TARGETPATH -n $_TESTFILE -m 300"
29
_CMD="dbus-test-runner --task ./$_TARGET -n $_TESTFILE -m 300"
44
30
if [ "$_MINIMAL" = "minimal" ]; then
45
31
_CMD="$_CMD -p -platform -p minimal"
48
if [ $_TARGETPATH != $_TESTFILEPATH ]; then
49
_CMD="$_CMD -p -input -p $_TESTFILEPATH"
33
if [ $_TARGET != $_TESTFILE ]; then
34
_CMD="$_CMD -p -input -p $_TESTFILE"
51
36
_CMD="$_CMD -p -maxwarnings -p 40"
54
39
function execute_test_cmd {
55
40
echo "Executing $_CMD $_ARGS"
56
echo "Working directory: $PWD"
57
if [ ! -x $_TARGETPATH ]; then
41
if [ ! -x $_TARGET ]; then
58
42
echo "Error: $_TARGET wasn't built!"
60
44
elif [ $DISPLAY ]; then
61
45
# https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999
62
46
# https://bugreports.qt-project.org/browse/QTBUG-36243
64
QML2_IMPORT_PATH=${_IMPORT_PATH} UBUNTU_UI_TOOLKIT_THEMES_PATH=${_THEMES_PATH} \
47
QML2_IMPORT_PATH=../../../modules:$QML2_IMPORT_PATH UBUNTU_UI_TOOLKIT_THEMES_PATH=../../../modules \
65
48
ALARM_BACKEND=memory \
66
SUPPRESS_SERVICEPROPERTIES_WARNINGS=yes \
67
49
$_CMD $_ARGS 2>&1 | grep -v 'QFontDatabase: Cannot find font directory'
68
50
# Note: Get first command before the pipe, $? would be ambiguous
69
51
RESULT=${PIPESTATUS[0]}