Merge lp:~jonas-drange/ubuntu-system-settings/qml-unit-tests into lp:ubuntu-system-settings

Proposed by Jonas G. Drange
Status: Work in progress
Proposed branch: lp:~jonas-drange/ubuntu-system-settings/qml-unit-tests
Merge into: lp:ubuntu-system-settings
Diff against target: 132 lines (+103/-1)
5 files modified
tests/plugins/CMakeLists.txt (+2/-1)
tests/plugins/cellular/CMakeLists.txt (+31/-0)
tests/plugins/cellular/Source/qmldir (+4/-0)
tests/plugins/cellular/tst_cellular.cpp (+22/-0)
tests/plugins/cellular/tst_cellular.qml (+44/-0)
To merge this branch: bzr merge lp:~jonas-drange/ubuntu-system-settings/qml-unit-tests
Reviewer Review Type Date Requested Status
Ubuntu Touch System Settings Pending
Review via email: mp+265527@code.launchpad.net
To post a comment you must log in.
1477. By Jonas G. Drange

copyright and move dbusmock links

Unmerged revisions

1477. By Jonas G. Drange

copyright and move dbusmock links

1476. By Jonas G. Drange

working test example

1475. By Jonas G. Drange

cleanup

1474. By Jonas G. Drange

add test files and current progress

1473. By Jonas G. Drange

style

1472. By Jonas G. Drange

add cell unit tests

1471. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1470. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

1469. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/plugins/CMakeLists.txt'
--- tests/plugins/CMakeLists.txt 2014-08-11 11:05:58 +0000
+++ tests/plugins/CMakeLists.txt 2015-07-22 13:47:47 +0000
@@ -1,3 +1,4 @@
1add_subdirectory(bluetooth)
2add_subdirectory(cellular)
1add_subdirectory(security-privacy)3add_subdirectory(security-privacy)
2add_subdirectory(system-update)4add_subdirectory(system-update)
3add_subdirectory(bluetooth)
45
=== added directory 'tests/plugins/cellular'
=== added file 'tests/plugins/cellular/CMakeLists.txt'
--- tests/plugins/cellular/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ tests/plugins/cellular/CMakeLists.txt 2015-07-22 13:47:47 +0000
@@ -0,0 +1,31 @@
1find_package(Qt5Core REQUIRED)
2find_package(Qt5Gui REQUIRED)
3find_package(Qt5Network REQUIRED)
4find_package(Qt5Qml REQUIRED)
5find_package(Qt5Quick REQUIRED)
6find_package(Qt5QuickTest REQUIRED)
7add_definitions(-DTESTS)
8
9set(XVFB_CMD xvfb-run -a -s "-screen 0 640x480x24")
10
11set(QML_SOURCES tst_cellular.qml)
12
13add_executable(tst-cellular tst_cellular.cpp)
14
15target_link_libraries(tst-cellular
16 Qt5::Core
17 Qt5::Gui
18 Qt5::Network
19 Qt5::Qml
20 Qt5::Quick
21 Qt5::QuickTest
22# ${QTDBUSMOCK_LIBRARIES}
23# ${QTDBUSTEST_LIBRARIES}
24)
25
26add_test(NAME tst-cellular COMMAND ${XVFB_CMD} ${CMAKE_CURRENT_BINARY_DIR}/tst-cellular
27 -input ${CMAKE_SOURCE_DIR}/tests/plugins/cellular/
28 -import ${PLUGIN_QML_DIR}
29 -import ${PLUGIN_PRIVATE_MODULE_DIR}
30 -import ${CMAKE_SOURCE_DIR}/tests/plugins/cellular
31)
032
=== added directory 'tests/plugins/cellular/Source'
=== added file 'tests/plugins/cellular/Source/qmldir'
--- tests/plugins/cellular/Source/qmldir 1970-01-01 00:00:00 +0000
+++ tests/plugins/cellular/Source/qmldir 2015-07-22 13:47:47 +0000
@@ -0,0 +1,4 @@
1module Source
2CellularPageComponent 1.0 ../../../../plugins/cellular/PageComponent.qml
3CellularPageChooseCarrier 1.0 ../../../../plugins/cellular/PageChooseCarrier.qml
4CellularSim 1.0 ../../../../plugins/cellular/Components/Sim.qml
05
=== added file 'tests/plugins/cellular/tst_cellular.cpp'
--- tests/plugins/cellular/tst_cellular.cpp 1970-01-01 00:00:00 +0000
+++ tests/plugins/cellular/tst_cellular.cpp 2015-07-22 13:47:47 +0000
@@ -0,0 +1,22 @@
1/*
2 * This file is part of system-settings
3 *
4 * Copyright (C) 2015 Canonical Ltd.
5 *
6 * Contact: Jonas G. Drange <jonas.drange@canonical.com>
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 3, as published
10 * by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranties of
14 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20#include <QtQuickTest/QtQuickTest>
21
22QUICK_TEST_MAIN(tst-cellular)
023
=== added file 'tests/plugins/cellular/tst_cellular.qml'
--- tests/plugins/cellular/tst_cellular.qml 1970-01-01 00:00:00 +0000
+++ tests/plugins/cellular/tst_cellular.qml 2015-07-22 13:47:47 +0000
@@ -0,0 +1,44 @@
1/*
2 * This file is part of system-settings
3 *
4 * Copyright (C) 2015 Canonical Ltd.
5 *
6 * Contact: Jonas G. Drange <jonas.drange@canonical.com>
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 3, as published
10 * by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranties of
14 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20import QtQuick 2.3
21import QtTest 1.0
22import Ubuntu.SystemSettings.Cellular 1.0
23
24import Source 1.0
25
26CellularPageChooseCarrier {
27
28 CellularSim {
29 id: phonesim
30 path: '/phonesim'
31 }
32
33 sim: phonesim
34
35 TestCase {
36 name: "ItemTests"
37 id: test1
38
39 function test_bar() {
40 verify(parent.sim)
41 }
42 }
43
44}

Subscribers

People subscribed via source and target branches