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
1=== modified file 'tests/plugins/CMakeLists.txt'
2--- tests/plugins/CMakeLists.txt 2014-08-11 11:05:58 +0000
3+++ tests/plugins/CMakeLists.txt 2015-07-22 13:47:47 +0000
4@@ -1,3 +1,4 @@
5+add_subdirectory(bluetooth)
6+add_subdirectory(cellular)
7 add_subdirectory(security-privacy)
8 add_subdirectory(system-update)
9-add_subdirectory(bluetooth)
10
11=== added directory 'tests/plugins/cellular'
12=== added file 'tests/plugins/cellular/CMakeLists.txt'
13--- tests/plugins/cellular/CMakeLists.txt 1970-01-01 00:00:00 +0000
14+++ tests/plugins/cellular/CMakeLists.txt 2015-07-22 13:47:47 +0000
15@@ -0,0 +1,31 @@
16+find_package(Qt5Core REQUIRED)
17+find_package(Qt5Gui REQUIRED)
18+find_package(Qt5Network REQUIRED)
19+find_package(Qt5Qml REQUIRED)
20+find_package(Qt5Quick REQUIRED)
21+find_package(Qt5QuickTest REQUIRED)
22+add_definitions(-DTESTS)
23+
24+set(XVFB_CMD xvfb-run -a -s "-screen 0 640x480x24")
25+
26+set(QML_SOURCES tst_cellular.qml)
27+
28+add_executable(tst-cellular tst_cellular.cpp)
29+
30+target_link_libraries(tst-cellular
31+ Qt5::Core
32+ Qt5::Gui
33+ Qt5::Network
34+ Qt5::Qml
35+ Qt5::Quick
36+ Qt5::QuickTest
37+# ${QTDBUSMOCK_LIBRARIES}
38+# ${QTDBUSTEST_LIBRARIES}
39+)
40+
41+add_test(NAME tst-cellular COMMAND ${XVFB_CMD} ${CMAKE_CURRENT_BINARY_DIR}/tst-cellular
42+ -input ${CMAKE_SOURCE_DIR}/tests/plugins/cellular/
43+ -import ${PLUGIN_QML_DIR}
44+ -import ${PLUGIN_PRIVATE_MODULE_DIR}
45+ -import ${CMAKE_SOURCE_DIR}/tests/plugins/cellular
46+)
47
48=== added directory 'tests/plugins/cellular/Source'
49=== added file 'tests/plugins/cellular/Source/qmldir'
50--- tests/plugins/cellular/Source/qmldir 1970-01-01 00:00:00 +0000
51+++ tests/plugins/cellular/Source/qmldir 2015-07-22 13:47:47 +0000
52@@ -0,0 +1,4 @@
53+module Source
54+CellularPageComponent 1.0 ../../../../plugins/cellular/PageComponent.qml
55+CellularPageChooseCarrier 1.0 ../../../../plugins/cellular/PageChooseCarrier.qml
56+CellularSim 1.0 ../../../../plugins/cellular/Components/Sim.qml
57
58=== added file 'tests/plugins/cellular/tst_cellular.cpp'
59--- tests/plugins/cellular/tst_cellular.cpp 1970-01-01 00:00:00 +0000
60+++ tests/plugins/cellular/tst_cellular.cpp 2015-07-22 13:47:47 +0000
61@@ -0,0 +1,22 @@
62+/*
63+ * This file is part of system-settings
64+ *
65+ * Copyright (C) 2015 Canonical Ltd.
66+ *
67+ * Contact: Jonas G. Drange <jonas.drange@canonical.com>
68+ *
69+ * This program is free software: you can redistribute it and/or modify it
70+ * under the terms of the GNU General Public License version 3, as published
71+ * by the Free Software Foundation.
72+ *
73+ * This program is distributed in the hope that it will be useful, but
74+ * WITHOUT ANY WARRANTY; without even the implied warranties of
75+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
76+ * PURPOSE. See the GNU General Public License for more details.
77+ *
78+ * You should have received a copy of the GNU General Public License along
79+ * with this program. If not, see <http://www.gnu.org/licenses/>.
80+ */
81+#include <QtQuickTest/QtQuickTest>
82+
83+QUICK_TEST_MAIN(tst-cellular)
84
85=== added file 'tests/plugins/cellular/tst_cellular.qml'
86--- tests/plugins/cellular/tst_cellular.qml 1970-01-01 00:00:00 +0000
87+++ tests/plugins/cellular/tst_cellular.qml 2015-07-22 13:47:47 +0000
88@@ -0,0 +1,44 @@
89+/*
90+ * This file is part of system-settings
91+ *
92+ * Copyright (C) 2015 Canonical Ltd.
93+ *
94+ * Contact: Jonas G. Drange <jonas.drange@canonical.com>
95+ *
96+ * This program is free software: you can redistribute it and/or modify it
97+ * under the terms of the GNU General Public License version 3, as published
98+ * by the Free Software Foundation.
99+ *
100+ * This program is distributed in the hope that it will be useful, but
101+ * WITHOUT ANY WARRANTY; without even the implied warranties of
102+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
103+ * PURPOSE. See the GNU General Public License for more details.
104+ *
105+ * You should have received a copy of the GNU General Public License along
106+ * with this program. If not, see <http://www.gnu.org/licenses/>.
107+ */
108+import QtQuick 2.3
109+import QtTest 1.0
110+import Ubuntu.SystemSettings.Cellular 1.0
111+
112+import Source 1.0
113+
114+CellularPageChooseCarrier {
115+
116+ CellularSim {
117+ id: phonesim
118+ path: '/phonesim'
119+ }
120+
121+ sim: phonesim
122+
123+ TestCase {
124+ name: "ItemTests"
125+ id: test1
126+
127+ function test_bar() {
128+ verify(parent.sim)
129+ }
130+ }
131+
132+}

Subscribers

People subscribed via source and target branches