summaryrefslogtreecommitdiffstats
path: root/recipes-graphics
diff options
context:
space:
mode:
authorMikhail Durnev <mikhail_durnev@mentor.com>2015-10-20 20:57:57 +1000
committerMikhail Durnev <mikhail_durnev@mentor.com>2015-10-23 13:23:27 +1000
commit0535df2c32dc562bd5f7704a599b982bc9e102df (patch)
tree75b95bccbc72362bd1c645ef07b8ca16279b56a1 /recipes-graphics
parentd272cfddde1bffa2b31cb5af382198e300d3a619 (diff)
wayland-ivi-extension: Build unit test apps
The wayland-ivi-extension package provides unit test applications. The recipe was modified to build those apps and install them on the target in a separate ipk/rpm package. The test apps are not compatible with ptest. Ctest is required to run them on the target. Change-Id: I937fde52eafc20f38ab7c8ff2d2981cc4f836f33 Signed-off-by: Mikhail Durnev <mikhail_durnev@mentor.com>
Diffstat (limited to 'recipes-graphics')
-rw-r--r--recipes-graphics/wayland/wayland-ivi-extension/cmake-find-gtest.patch22
-rw-r--r--recipes-graphics/wayland/wayland-ivi-extension/test-path.patch46
-rw-r--r--recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bbappend23
3 files changed, 91 insertions, 0 deletions
diff --git a/recipes-graphics/wayland/wayland-ivi-extension/cmake-find-gtest.patch b/recipes-graphics/wayland/wayland-ivi-extension/cmake-find-gtest.patch
new file mode 100644
index 00000000..5371174d
--- /dev/null
+++ b/recipes-graphics/wayland/wayland-ivi-extension/cmake-find-gtest.patch
@@ -0,0 +1,22 @@
+diff -Naur old/ivi-input-api/test/CMakeLists.txt new/ivi-input-api/test/CMakeLists.txt
+--- old/ivi-input-api/test/CMakeLists.txt 2015-10-19 23:31:13.000000000 +1000
++++ new/ivi-input-api/test/CMakeLists.txt 2015-10-19 23:30:32.000000000 +1000
+@@ -18,6 +18,7 @@
+ ############################################################################
+
+ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
++SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/modules)
+
+ FIND_PACKAGE(gtest)
+
+diff -Naur old/ivi-layermanagement-api/test/CMakeLists.txt new/ivi-layermanagement-api/test/CMakeLists.txt
+--- old/ivi-layermanagement-api/test/CMakeLists.txt 2015-10-19 23:31:20.000000000 +1000
++++ new/ivi-layermanagement-api/test/CMakeLists.txt 2015-10-19 23:30:48.000000000 +1000
+@@ -18,6 +18,7 @@
+ ############################################################################
+
+ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
++SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/modules)
+
+ FIND_PACKAGE(gtest)
+
diff --git a/recipes-graphics/wayland/wayland-ivi-extension/test-path.patch b/recipes-graphics/wayland/wayland-ivi-extension/test-path.patch
new file mode 100644
index 00000000..9de50187
--- /dev/null
+++ b/recipes-graphics/wayland/wayland-ivi-extension/test-path.patch
@@ -0,0 +1,46 @@
+diff -Naur old/ivi-input-api/test/CMakeLists.txt new/ivi-input-api/test/CMakeLists.txt
+--- old/ivi-input-api/test/CMakeLists.txt 2015-10-20 00:25:36.000000000 +1000
++++ new/ivi-input-api/test/CMakeLists.txt 2015-10-20 17:57:45.000000000 +1000
+@@ -66,14 +66,15 @@
+ ADD_DEPENDENCIES(${PROJECT_NAME} ${LIBS})
+
+ IF(INSTALL_ILM_API_TESTS)
+- INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
++ INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/test)
++ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/test/ivi-input-api)
+ ENDIF()
+
+ # use CTest
+ ENABLE_TESTING()
+- ADD_TEST(ilmCommon ${PROJECT_NAME})
+- ADD_TEST(ilmClient ${PROJECT_NAME})
+- ADD_TEST(ilmControl ${PROJECT_NAME})
+- ADD_TEST(ilmInput ${PROJECT_NAME})
++ ADD_TEST(ilmCommon ${CMAKE_INSTALL_LIBEXECDIR}/test/${PROJECT_NAME})
++ ADD_TEST(ilmClient ${CMAKE_INSTALL_LIBEXECDIR}/test/${PROJECT_NAME})
++ ADD_TEST(ilmControl ${CMAKE_INSTALL_LIBEXECDIR}/test/${PROJECT_NAME})
++ ADD_TEST(ilmInput ${CMAKE_INSTALL_LIBEXECDIR}/test/${PROJECT_NAME})
+
+ ENDIF()
+diff -Naur old/ivi-layermanagement-api/test/CMakeLists.txt new/ivi-layermanagement-api/test/CMakeLists.txt
+--- old/ivi-layermanagement-api/test/CMakeLists.txt 2015-10-20 00:25:36.000000000 +1000
++++ new/ivi-layermanagement-api/test/CMakeLists.txt 2015-10-20 17:57:24.000000000 +1000
+@@ -64,13 +64,14 @@
+ ADD_DEPENDENCIES(${PROJECT_NAME} ${LIBS})
+
+ IF(INSTALL_ILM_API_TESTS)
+- INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
++ INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/test)
++ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/test/ivi-layermanagement-api)
+ ENDIF()
+
+ # use CTest
+ ENABLE_TESTING()
+- ADD_TEST(ilmCommon ${PROJECT_NAME})
+- ADD_TEST(ilmClient ${PROJECT_NAME})
+- ADD_TEST(ilmControl ${PROJECT_NAME})
++ ADD_TEST(ilmCommon ${CMAKE_INSTALL_LIBEXECDIR}/test/${PROJECT_NAME})
++ ADD_TEST(ilmClient ${CMAKE_INSTALL_LIBEXECDIR}/test/${PROJECT_NAME})
++ ADD_TEST(ilmControl ${CMAKE_INSTALL_LIBEXECDIR}/test/${PROJECT_NAME})
+
+ ENDIF()
diff --git a/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bbappend b/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bbappend
index f30bf7f1..da97895a 100644
--- a/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bbappend
+++ b/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bbappend
@@ -1,5 +1,28 @@
FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
+ENABLE_TEST = "-DBUILD_ILM_API_TESTS:BOOL=TRUE \
+ -DINSTALL_ILM_API_TESTS:BOOL=TRUE \
+ "
+
+DISABLE_TEST = "-DBUILD_ILM_API_TESTS:BOOL=FALSE \
+ -DINSTALL_ILM_API_TESTS:BOOL=FALSE \
+ "
+
+PACKAGECONFIG ??= "test"
+PACKAGECONFIG[test] = "${ENABLE_TEST},${DISABLE_TEST},gtest"
+
SRC_URI_append = "\
file://0001-wayland-ivi-extension-patch-for-wl-shell-emulator.patch \
+ file://cmake-find-gtest.patch \
+ file://test-path.patch \
"
+
+PACKAGES =+ "${PN}-test"
+
+FILES_${PN}-test = "${libdir}/${PN}/test/*/CTestTestfile.cmake \
+ ${libdir}/${PN}/test/ivi-layermanagement-api-test \
+ ${libdir}/${PN}/test/ivi-input-api-test \
+ "
+FILES_${PN}-dbg += "${libdir}/${PN}/test/.debug"
+
+RDEPENDS_${PN}-test += "cmake"
u { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*
 * Copyright (c) 2018 TOYOTA MOTOR CORPORATION
 * Copyright (C) 2016 The Qt Company Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import QtQuick 2.6
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
import Translator 1.0

import QtQuick.Window 2.13

ApplicationWindow {
    id: root

    width: container.width * container.scale
    height: container.height * container.scale

    Translator {
        id: translator
    }

    property double vehicleSpeed: 0
    property double engineSpeed: 0

    Connections {
        target: SignalComposer

        onSignalEvent: {
            if (uid === "event.vehicle.speed") {
                var speed_tmp = parseFloat(value)
                if(units == "km/h") {
                    speed_tmp /= 1.609
                }
                vehicleSpeed = speed_tmp
            }
            else if (uid === "event.engine.speed") {
                engineSpeed = parseFloat(value)
                tachometer.value = engineSpeed / 7000
            }
        }
    }

    Item {
        id: container
        anchors.centerIn: parent
        width: Window.width
        height: Window.height
        //scale: screenInfo.scale_factor()
        scale: 1

    Label {
        id: speed
        anchors.left: parent.left
        anchors.top: parent.top
        anchors.margins: 20
        text: vehicleSpeed.toFixed(0)         /* MPH */
        font.pixelSize: 256
    }
    Label {
        id: unit
        anchors.left: speed.right
        anchors.baseline: speed.baseline
        text: 'MPH'
        font.pixelSize: 64
    }
    Label {
        anchors.left: unit.left
        anchors.top: unit.bottom
        text: '10,000.5 miles'
        font.pixelSize: 32
        opacity: 0.5
    }

    Image {
        id: car
        anchors.centerIn: parent
        source: './images/HMI_Dashboard_Car.png'
    }

    TirePressure {
        anchors.right: car.left
        anchors.rightMargin: -20
        anchors.top: car.top
        anchors.topMargin: 150
        title: translator.translate(qsTr('LEFT FRONT TIRE'), translator.language)
        pressure: translator.translate(qsTr('%1 PSI').arg(23.1), translator.language)
    }

    TirePressure {
        anchors.right: car.left
        anchors.rightMargin: -20
        anchors.bottom: car.bottom
        anchors.bottomMargin: 120
        title: translator.translate(qsTr('LEFT REAR TIRE'), translator.language)
        pressure: translator.translate(qsTr('%1 PSI').arg(31.35), translator.language)
    }

    TirePressure {
        mirror: true
        anchors.left: car.right
        anchors.leftMargin: -20
        anchors.top: car.top
        anchors.topMargin: 150
        title: translator.translate(qsTr('RIGHT FRONT TIRE'), translator.language)
        pressure: translator.translate(qsTr('%1 PSI').arg(24.2), translator.language)
    }

    TirePressure {
        mirror: true
        anchors.left: car.right
        anchors.leftMargin: -20
        anchors.bottom : car.bottom
        anchors.bottomMargin: 120
        title: translator.translate(qsTr('RIGHT REAR TIRE'), translator.language)
        pressure: translator.translate(qsTr('%1 PSI').arg(33.0), translator.language)
    }

    RowLayout {
        anchors.left: parent.left
        anchors.right: parent.right
        anchors.bottom: parent.bottom
        anchors.margins: 100

        Image {
            id: speedIcon
            source: './images/HMI_Dashboard_Speed_Icon.svg'
        }
        ProgressBar {
            id: tachometer
            Layout.fillWidth: true
            value: engineSpeed / 65535
            Label {
                anchors.left: parent.left
                anchors.top: parent.bottom
                anchors.topMargin: 10
                text: translator.translate(qsTr('(RPM)'), translator.language)
                font.pixelSize: 26
            }
        }
        Item {
            width: 30
            height: 30
        }
        Image {
            id: fuelIcon
            source: './images/HMI_Dashboard_Fuel_Icon.svg'
        }
        ProgressBar {
            Layout.fillWidth: true
            value: 0.66
            Image {
                anchors.left: parent.left
                anchors.leftMargin: -40
                anchors.bottom: parent.top
                source: './images/HMI_Dashboard_Fuel_Details.svg'
                GridLayout {
                    anchors.fill: parent
                    columns: 2
                    rowSpacing: -10
                    Label {
                        Layout.fillWidth: true
                        Layout.preferredWidth: 3
                        Layout.fillHeight: true
                        verticalAlignment: Label.AlignVCenter
                        horizontalAlignment: Label.AlignRight
                        text: translator.translate(qsTr('LEVEL:'), translator.language)
                        font.pixelSize: 24
                    }
                    Label {
                        Layout.fillWidth: true
                        Layout.preferredWidth: 4
                        Layout.fillHeight: true
                        verticalAlignment: Label.AlignVCenter
                        horizontalAlignment: Label.AlignLeft
                        text: translator.translate(qsTr('%1 GALLONS').arg(9), translator.language)
                        font.pixelSize: 24
                        color: '#00ADDC'
                    }
                    Label {
                        Layout.fillWidth: true
                        Layout.preferredWidth: 3
                        Layout.fillHeight: true
                        verticalAlignment: Label.AlignVCenter
                        horizontalAlignment: Label.AlignRight
                        text: translator.translate(qsTr('RANGE:'), translator.language)
                        font.pixelSize: 24
                    }
                    Label {
                        Layout.fillWidth: true
                        Layout.preferredWidth: 4
                        Layout.fillHeight: true
                        verticalAlignment: Label.AlignVCenter
                        horizontalAlignment: Label.AlignLeft
                        text: translator.translate(qsTr('%1 MI').arg(9), translator.language)
                        font.pixelSize: 24
                        color: '#00ADDC'
                    }
                    Label {
                        Layout.fillWidth: true
                        Layout.preferredWidth: 3
                        Layout.fillHeight: true
                        verticalAlignment: Label.AlignVCenter
                        horizontalAlignment: Label.AlignRight
                        text: translator.translate(qsTr('AVG:'), translator.language)
                        font.pixelSize: 24
                    }
                    Label {
                        Layout.fillWidth: true
                        Layout.preferredWidth: 4
                        Layout.fillHeight: true
                        verticalAlignment: Label.AlignVCenter
                        horizontalAlignment: Label.AlignLeft
                        text: translator.translate(qsTr('%1 MPG').arg(25.5), translator.language)
                        font.pixelSize: 24
                        color: '#00ADDC'
                    }
                }
            }

            Label {
                anchors.left: parent.left
                anchors.top: parent.bottom
                anchors.topMargin: 10
                text: translator.translate(qsTr('FUEL'), translator.language)
                font.pixelSize: 26
            }
        }
    }

    RowLayout {
        anchors.bottom: parent.bottom
        anchors.horizontalCenter: parent.horizontalCenter
        Repeater {
            model: ListModel {
                ListElement {
                    code: 'C'
                    language: QT_TR_NOOP('English')
                }
                ListElement {
                    code: 'fr_FR'
                    language: QT_TR_NOOP('Français')
                }
                ListElement {
                    code: 'ja_JP'
                    language: QT_TR_NOOP('日本語')
                }
                ListElement {
                    code: 'zh_CN'
                    language: QT_TR_NOOP('中文简体')
                }
                ListElement {
                    code: 'ko_KR'
                    language: QT_TR_NOOP('한국어')
                }
            }

            Button {
                text: qsTr(model.language)
                onClicked: {
                    translator.language = model.code
                    console.log ("Scale = " + screenInfo.scale_factor())
                }
            }
        }
    }
}
}