Merge lp:~xnox/ubuntu-ui-toolkit/py32ap+listview-scroll_to_bottom+qmlapicheckverbose into lp:ubuntu-ui-toolkit
- py32ap+listview-scroll_to_bottom+qmlapicheckverbose
- Merge into trunk
Status: | Rejected |
---|---|
Rejected by: | Zoltan Balogh |
Proposed branch: | lp:~xnox/ubuntu-ui-toolkit/py32ap+listview-scroll_to_bottom+qmlapicheckverbose |
Merge into: | lp:ubuntu-ui-toolkit |
Diff against target: |
607 lines (+224/-117) 15 files modified
components.api (+23/-0) debian/control (+9/-6) debian/rules (+1/-0) debian/ubuntu-ui-toolkit-autopilot.install (+2/-1) run_tests.sh (+2/-2) tests/autopilot/ubuntuuitoolkit/base.py (+3/-2) tests/autopilot/ubuntuuitoolkit/emulators.py (+79/-37) tests/autopilot/ubuntuuitoolkit/fixture_setup.py (+1/-1) tests/autopilot/ubuntuuitoolkit/tests/test_emulators.py (+29/-54) tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py (+6/-1) tests/qmlapicheck.py (+4/-2) tests/qmlapicheck.sh (+52/-0) tests/tests.pro (+5/-2) tests/unit/add_qmlmakecheck.pri (+2/-8) ubuntu-sdk.pro (+6/-1) |
To merge this branch: | bzr merge lp:~xnox/ubuntu-ui-toolkit/py32ap+listview-scroll_to_bottom+qmlapicheckverbose |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Dimitri John Ledkov (community) | Approve | ||
Ubuntu SDK team | Pending | ||
Review via email: mp+208859@code.launchpad.net |
Commit message
Merge approved branches and resolve conflicts.
Description of the change
Merge approved branches and resolve conflicts.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:956
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Unmerged revisions
Preview Diff
1 | === modified file 'components.api' |
2 | --- components.api 2014-02-13 17:22:21 +0000 |
3 | +++ components.api 2014-02-28 17:59:31 +0000 |
4 | @@ -566,6 +566,11 @@ |
5 | modules/Ubuntu/PerformanceMetrics/PerformanceOverlay.qml |
6 | Item |
7 | property bool active |
8 | +modules/Ubuntu/Test/UbuntuTestCase.qml |
9 | +TestCase |
10 | + function findChild(obj,objectName) |
11 | + function findInvisibleChild(obj,objectName) |
12 | + function mouseMoveSlowly(item,x,y,dx,dy,steps,stepdelay) |
13 | plugins.qmltypes |
14 | name: "InverseMouseAreaType" |
15 | prototype: "QQuickMouseArea" |
16 | @@ -750,6 +755,24 @@ |
17 | Parameter { name: "singular"; type: "string" } |
18 | Parameter { name: "plural"; type: "string" } |
19 | Parameter { name: "n"; type: "int" } |
20 | + name: "ULConditionalLayout" |
21 | + prototype: "QObject" |
22 | + exports: ["ConditionalLayout 0.1"] |
23 | + Property { name: "name"; type: "string" } |
24 | + Property { name: "when"; type: "QQmlBinding"; isPointer: true } |
25 | + Property { name: "layout"; type: "QQmlComponent"; isPointer: true } |
26 | + name: "ULItemLayout" |
27 | + prototype: "QQuickItem" |
28 | + exports: ["ItemLayout 0.1"] |
29 | + Property { name: "item"; type: "string" } |
30 | + name: "ULLayouts" |
31 | + prototype: "QQuickItem" |
32 | + exports: ["Layouts 0.1"] |
33 | + Property { name: "currentLayout"; type: "string"; isReadonly: true } |
34 | + Property { name: "layouts"; type: "ULConditionalLayout"; isList: true; isReadonly: true } |
35 | + name: "ULLayoutsAttached" |
36 | + prototype: "QObject" |
37 | + Property { name: "item"; type: "string" } |
38 | name: "UPMCpuUsage" |
39 | prototype: "QQuickItem" |
40 | exports: ["CpuUsage 0.1"] |
41 | |
42 | === modified file 'debian/control' |
43 | --- debian/control 2014-02-12 09:20:43 +0000 |
44 | +++ debian/control 2014-02-28 17:59:31 +0000 |
45 | @@ -6,6 +6,7 @@ |
46 | devscripts, |
47 | libgles2-mesa-dev, |
48 | libglib2.0-dev, |
49 | + python3, |
50 | python, |
51 | libqt5qml-graphicaleffects | libqt5graphicaleffects5, |
52 | qt5-default, |
53 | @@ -22,12 +23,12 @@ |
54 | qtdeclarative5-qtfeedback-plugin, |
55 | qtdeclarative5-unity-action-plugin (>= 1.1.0), |
56 | qtdeclarative5-localstorage-plugin, |
57 | - qtdeclarative5-doc-html, |
58 | - qtwebkit5-doc-html, |
59 | - qtsvg5-doc-html, |
60 | - qtscript5-doc-html, |
61 | - qtmultimedia5-doc-html, |
62 | - unity-action-doc, |
63 | + qtdeclarative5-doc-html, |
64 | + qtwebkit5-doc-html, |
65 | + qtsvg5-doc-html, |
66 | + qtscript5-doc-html, |
67 | + qtmultimedia5-doc-html, |
68 | + unity-action-doc, |
69 | devscripts, |
70 | libqt5organizer5, |
71 | qtpim5-dev, |
72 | @@ -133,6 +134,8 @@ |
73 | python-autopilot (>= 1.4), |
74 | python-fixtures, |
75 | python-mock, |
76 | + python3-fixtures, |
77 | + python3-autopilot (>= 1.4), |
78 | ubuntu-ui-toolkit-examples (>= ${source:Version}), |
79 | Description: Test package for Ubuntu UI Toolkit |
80 | Autopilot tests for the ubuntu-ui-toolkit package |
81 | |
82 | === modified file 'debian/rules' |
83 | --- debian/rules 2014-01-22 16:25:25 +0000 |
84 | +++ debian/rules 2014-02-28 17:59:31 +0000 |
85 | @@ -11,6 +11,7 @@ |
86 | override_dh_auto_test: |
87 | ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) |
88 | mkdir -p debian/tmp/home/run |
89 | + chmod +x tests/xvfb.sh |
90 | tests/xvfb.sh dh_auto_test || exit $? |
91 | endif |
92 | |
93 | |
94 | === modified file 'debian/ubuntu-ui-toolkit-autopilot.install' |
95 | --- debian/ubuntu-ui-toolkit-autopilot.install 2013-10-30 11:35:57 +0000 |
96 | +++ debian/ubuntu-ui-toolkit-autopilot.install 2014-02-28 17:59:31 +0000 |
97 | @@ -1,1 +1,2 @@ |
98 | -usr/lib/python2.7/dist-packages/ubuntuuitoolkit |
99 | +usr/lib/python3 |
100 | +usr/lib/python2.7 |
101 | |
102 | === modified file 'run_tests.sh' |
103 | --- run_tests.sh 2013-07-23 22:15:05 +0000 |
104 | +++ run_tests.sh 2014-02-28 17:59:31 +0000 |
105 | @@ -20,9 +20,9 @@ |
106 | echo running with arg: $1 |
107 | |
108 | if [ "$1" == "" ]; then |
109 | - autopilot run ubuntuuitoolkit |
110 | + python3 -m autopilot.run run ubuntuuitoolkit |
111 | else |
112 | - autopilot run -o ../../$1 -f xml -r -rd ../../ ubuntuuitoolkit |
113 | + python3 -m autopilot.run run -o ../../$1 -f xml -r -rd ../../ ubuntuuitoolkit |
114 | fi |
115 | |
116 | exit 0 |
117 | |
118 | === modified file 'tests/autopilot/ubuntuuitoolkit/base.py' |
119 | --- tests/autopilot/ubuntuuitoolkit/base.py 2013-11-15 05:11:10 +0000 |
120 | +++ tests/autopilot/ubuntuuitoolkit/base.py 2014-02-28 17:59:31 +0000 |
121 | @@ -31,8 +31,9 @@ |
122 | # configuration on devices and it seems the environment variable |
123 | # QT_SELECT=qt5 doesn't work for autopilot tests. --Mirv - 2013-10-03 |
124 | arch = subprocess.check_output( |
125 | - ["dpkg-architecture", "-qDEB_HOST_MULTIARCH"]).strip() |
126 | - return '/usr/lib/{}/qt5/bin/qmlscene'.format(arch.decode()) |
127 | + ["dpkg-architecture", "-qDEB_HOST_MULTIARCH"], |
128 | + universal_newlines=True).strip() |
129 | + return '/usr/lib/{}/qt5/bin/qmlscene'.format(arch) |
130 | |
131 | |
132 | class UbuntuUIToolkitAppTestCase(testcase.AutopilotTestCase): |
133 | |
134 | === modified file 'tests/autopilot/ubuntuuitoolkit/emulators.py' |
135 | --- tests/autopilot/ubuntuuitoolkit/emulators.py 2014-01-30 15:26:21 +0000 |
136 | +++ tests/autopilot/ubuntuuitoolkit/emulators.py 2014-02-28 17:59:31 +0000 |
137 | @@ -15,7 +15,6 @@ |
138 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
139 | |
140 | import logging |
141 | -import time |
142 | from distutils import version |
143 | |
144 | import autopilot |
145 | @@ -527,7 +526,7 @@ |
146 | def click_element(self, objectName): |
147 | """Click an element from the list. |
148 | |
149 | - It swipes the element into view if it's not fully visible. |
150 | + It swipes the element into view if it's center is not visible. |
151 | |
152 | :parameter objectName: The objectName property of the element to click. |
153 | |
154 | @@ -537,38 +536,81 @@ |
155 | self.pointing_device.click_object(element) |
156 | |
157 | def _swipe_element_into_view(self, objectName): |
158 | - element = self.select_single(objectName=objectName) |
159 | - x, y, width, height = self.globalRect |
160 | - start_x = x + (width / 2) |
161 | - start_y = y + (height / 2) |
162 | + element = self._select_element(objectName) |
163 | |
164 | - while not self._is_element_fully_visible(objectName): |
165 | - stop_x = start_x |
166 | + while not self._is_element_clickable(objectName): |
167 | if element.globalRect.y < self.globalRect.y: |
168 | - stop_y = start_y + element.implicitHeight |
169 | - else: |
170 | - stop_y = start_y - element.implicitHeight |
171 | - |
172 | - if platform.model() == 'Desktop': |
173 | - # The drag on the desktop is done two fast, so we are left at |
174 | - # the bottom or at the top of the list, sometimes missing the |
175 | - # element we are looking for. |
176 | - # TODO: use the slow drag once it's implemented: |
177 | - # https://bugs.launchpad.net/autopilot/+bug/1257055 |
178 | - # --elopio - 2014-01-09 |
179 | - self.pointing_device.move(start_x, start_y) |
180 | - self.pointing_device.press() |
181 | - self.pointing_device.move(stop_x, stop_y) |
182 | - time.sleep(0.3) |
183 | - self.pointing_device.release() |
184 | - else: |
185 | - self.pointing_device.drag(start_x, start_y, stop_x, stop_y) |
186 | - |
187 | - def _is_element_fully_visible(self, objectName): |
188 | + self._show_more_elements_above() |
189 | + else: |
190 | + self._show_more_elements_below() |
191 | + |
192 | + def _select_element(self, object_name): |
193 | + try: |
194 | + return self.select_single(objectName=object_name) |
195 | + except dbus.StateNotFoundError: |
196 | + # If the list is big, elements will only be created when we scroll |
197 | + # them into view. |
198 | + self._scroll_to_top() |
199 | + while not self.atYEnd: |
200 | + self._show_more_elements_below() |
201 | + try: |
202 | + return self.select_single(objectName=object_name) |
203 | + except dbus.StateNotFoundError: |
204 | + pass |
205 | + raise ToolkitEmulatorException( |
206 | + 'List element with objectName "{}" not found.'.format( |
207 | + object_name)) |
208 | + |
209 | + @autopilot_logging.log_action(logger.info) |
210 | + def _scroll_to_top(self): |
211 | + x, y, width, height = self.globalRect |
212 | + while not self.atYBeginning: |
213 | + self._show_more_elements_above() |
214 | + |
215 | + @autopilot_logging.log_action(logger.info) |
216 | + def _show_more_elements_below(self): |
217 | + if self.atYEnd: |
218 | + raise ToolkitEmulatorException('There are no more elements below.') |
219 | + else: |
220 | + self._show_more_elements('below') |
221 | + |
222 | + @autopilot_logging.log_action(logger.info) |
223 | + def _show_more_elements_above(self): |
224 | + if self.atYBeginning: |
225 | + raise ToolkitEmulatorException('There are no more elements above.') |
226 | + else: |
227 | + self._show_more_elements('above') |
228 | + |
229 | + def _show_more_elements(self, direction): |
230 | + x, y, width, height = self.globalRect |
231 | + start_x = stop_x = x + (width // 2) |
232 | + # Start and stop just a little under the top of the list. |
233 | + top = y + 5 |
234 | + bottom = y + height - 5 |
235 | + if direction == 'below': |
236 | + start_y = bottom |
237 | + stop_y = top |
238 | + elif direction == 'above': |
239 | + start_y = top |
240 | + stop_y = bottom |
241 | + else: |
242 | + raise ToolkitEmulatorException( |
243 | + 'Invalid direction {}.'.format(direction)) |
244 | + self._slow_drag(start_x, stop_x, start_y, stop_y) |
245 | + self.dragging.wait_for(False) |
246 | + self.moving.wait_for(False) |
247 | + |
248 | + def _slow_drag(self, start_x, stop_x, start_y, stop_y): |
249 | + # If we drag too fast, we end up scrolling more than what we |
250 | + # should, sometimes missing the element we are looking for. |
251 | + self.pointing_device.drag(start_x, start_y, stop_x, stop_y, rate=5) |
252 | + |
253 | + def _is_element_clickable(self, objectName): |
254 | + """Return True if the center of the element is visible.""" |
255 | element = self.select_single(objectName=objectName) |
256 | - return (element.globalRect.y >= self.globalRect.y and |
257 | - element.globalRect.y + element.globalRect.height <= |
258 | - self.globalRect.y + self.globalRect.height) |
259 | + element_center = element.globalRect.y + element.globalRect.height // 2 |
260 | + return (element_center >= self.globalRect.y and |
261 | + element_center <= self.globalRect.y + self.globalRect.height) |
262 | |
263 | |
264 | class Empty(UbuntuUIToolkitEmulatorBase): |
265 | @@ -587,7 +629,7 @@ |
266 | @autopilot_logging.log_action(logger.info) |
267 | def swipe_to_delete(self, direction='right'): |
268 | """Swipe the item in a specific direction.""" |
269 | - if (self.removable): |
270 | + if self.removable: |
271 | self._drag_pointing_device_to_delete(direction) |
272 | if self.confirmRemoval: |
273 | self.waitingConfirmationForRemoval.wait_for(True) |
274 | @@ -599,12 +641,12 @@ |
275 | |
276 | def _drag_pointing_device_to_delete(self, direction): |
277 | x, y, w, h = self.globalRect |
278 | - tx = x + (w / 8) |
279 | - ty = y + (h / 2) |
280 | + tx = x + (w // 8) |
281 | + ty = y + (h // 2) |
282 | |
283 | - if (direction == 'right'): |
284 | + if direction == 'right': |
285 | self.pointing_device.drag(tx, ty, w, ty) |
286 | - elif (direction == 'left'): |
287 | + elif direction == 'left': |
288 | self.pointing_device.drag(w - (w*0.1), ty, x, ty) |
289 | else: |
290 | raise ToolkitEmulatorException( |
291 | @@ -622,7 +664,7 @@ |
292 | @autopilot_logging.log_action(logger.info) |
293 | def confirm_removal(self): |
294 | """Comfirm item removal if this was already swiped.""" |
295 | - if (self.waitingConfirmationForRemoval): |
296 | + if self.waitingConfirmationForRemoval: |
297 | deleteButton = self._get_confirm_button() |
298 | self.pointing_device.click_object(deleteButton) |
299 | self._wait_until_deleted() |
300 | |
301 | === modified file 'tests/autopilot/ubuntuuitoolkit/fixture_setup.py' |
302 | --- tests/autopilot/ubuntuuitoolkit/fixture_setup.py 2014-02-12 09:20:43 +0000 |
303 | +++ tests/autopilot/ubuntuuitoolkit/fixture_setup.py 2014-02-28 17:59:31 +0000 |
304 | @@ -87,7 +87,7 @@ |
305 | qmlscene=base.get_qmlscene_launch_command(), |
306 | qml_file_path=qml_file_path)) |
307 | desktop_file.write('[Desktop Entry]\n') |
308 | - for key, value in self._desktop_file_dict.iteritems(): |
309 | + for key, value in self._desktop_file_dict.items(): |
310 | desktop_file.write('{key}={value}\n'.format(key=key, value=value)) |
311 | desktop_file.close() |
312 | return desktop_file.name |
313 | |
314 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/test_emulators.py' |
315 | --- tests/autopilot/ubuntuuitoolkit/tests/test_emulators.py 2014-01-13 15:23:25 +0000 |
316 | +++ tests/autopilot/ubuntuuitoolkit/tests/test_emulators.py 2014-02-28 17:59:31 +0000 |
317 | @@ -14,7 +14,6 @@ |
318 | # You should have received a copy of the GNU Lesser General Public License |
319 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
320 | |
321 | -import mock |
322 | import time |
323 | import unittest |
324 | |
325 | @@ -22,6 +21,10 @@ |
326 | from autopilot import input, platform |
327 | from autopilot.introspection import dbus |
328 | from testtools.matchers import GreaterThan, LessThan |
329 | +try: |
330 | + from unittest import mock |
331 | +except ImportError: |
332 | + import mock |
333 | |
334 | from ubuntuuitoolkit import emulators, tests |
335 | |
336 | @@ -574,47 +577,6 @@ |
337 | text: "No element clicked." |
338 | } |
339 | |
340 | - ListModel { |
341 | - id: testModel |
342 | - |
343 | - ListElement { |
344 | - objectName: "testListElement1" |
345 | - label: "test list element 1" |
346 | - } |
347 | - ListElement { |
348 | - objectName: "testListElement2" |
349 | - label: "test list element 2" |
350 | - } |
351 | - ListElement { |
352 | - objectName: "testListElement3" |
353 | - label: "test list element 3" |
354 | - } |
355 | - ListElement { |
356 | - objectName: "testListElement4" |
357 | - label: "test list element 4" |
358 | - } |
359 | - ListElement { |
360 | - objectName: "testListElement5" |
361 | - label: "test list element 5" |
362 | - } |
363 | - ListElement { |
364 | - objectName: "testListElement6" |
365 | - label: "test list element 6" |
366 | - } |
367 | - ListElement { |
368 | - objectName: "testListElement7" |
369 | - label: "test list element 7" |
370 | - } |
371 | - ListElement { |
372 | - objectName: "testListElement8" |
373 | - label: "test list element 8" |
374 | - } |
375 | - ListElement { |
376 | - objectName: "testListElement9" |
377 | - label: "test list element 9" |
378 | - } |
379 | - } |
380 | - |
381 | ListView { |
382 | id: testListView |
383 | objectName: "testListView" |
384 | @@ -622,13 +584,13 @@ |
385 | anchors.right: parent.right |
386 | height: column.height - clickedLabel.paintedHeight |
387 | clip: true |
388 | - model: testModel |
389 | + model: 20 |
390 | |
391 | delegate: ListItem.Standard { |
392 | - text: model.label |
393 | - objectName: model.objectName |
394 | - onClicked: clickedLabel.text = model.objectName |
395 | - height: units.gu(5) |
396 | + objectName: "testListElement%1".arg(index) |
397 | + text: "test list element %1".arg(index) |
398 | + onClicked: clickedLabel.text = objectName |
399 | + height: units.gu(5) |
400 | } |
401 | } |
402 | } |
403 | @@ -648,32 +610,45 @@ |
404 | self.assertIsInstance(self.list_view, emulators.QQuickListView) |
405 | |
406 | def test_click_element(self): |
407 | - self.list_view.click_element('testListElement1') |
408 | - self.assertEqual(self.label.text, 'testListElement1') |
409 | + self.list_view.click_element('testListElement0') |
410 | + self.assertEqual(self.label.text, 'testListElement0') |
411 | |
412 | def test_click_element_outside_view_below(self): |
413 | # Click the first element out of view to make sure we are not scrolling |
414 | # to the bottom at once. |
415 | self.assertFalse( |
416 | - self.list_view._is_element_fully_visible('testListElement5')) |
417 | + self.list_view._is_element_clickable('testListElement5')) |
418 | |
419 | self.list_view.click_element('testListElement5') |
420 | self.assertEqual(self.label.text, 'testListElement5') |
421 | |
422 | def test_click_element_outside_view_above(self): |
423 | - # First we need to scroll to the 8th element in order for the 9th to be |
424 | - # created. |
425 | - self.list_view.click_element('testListElement8') |
426 | self.list_view.click_element('testListElement9') |
427 | |
428 | # Click the first element out of view to make sure we are not scrolling |
429 | # to the top at once. |
430 | self.assertFalse( |
431 | - self.list_view._is_element_fully_visible('testListElement4')) |
432 | + self.list_view._is_element_clickable('testListElement4')) |
433 | |
434 | self.list_view.click_element('testListElement4') |
435 | self.assertEqual(self.label.text, 'testListElement4') |
436 | |
437 | + def test_click_element_not_created_at_start(self): |
438 | + objectName = 'testListElement19' |
439 | + self.assertRaises( |
440 | + dbus.StateNotFoundError, |
441 | + self.list_view.select_single, |
442 | + objectName=objectName) |
443 | + self.list_view.click_element(objectName) |
444 | + |
445 | + def test_click_unexisting_element(self): |
446 | + error = self.assertRaises( |
447 | + emulators.ToolkitEmulatorException, |
448 | + self.list_view.click_element, |
449 | + 'unexisting') |
450 | + self.assertEqual( |
451 | + str(error), 'List element with objectName "unexisting" not found.') |
452 | + |
453 | |
454 | class SwipeToDeleteTestCase(tests.QMLStringAppTestCase): |
455 | |
456 | |
457 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py' |
458 | --- tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py 2014-02-12 18:41:20 +0000 |
459 | +++ tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py 2014-02-28 17:59:31 +0000 |
460 | @@ -16,7 +16,12 @@ |
461 | |
462 | import os |
463 | |
464 | -import mock |
465 | +try: |
466 | + # Python 3. |
467 | + from unittest import mock |
468 | +except ImportError: |
469 | + # Python 2 add-on: python-mock. |
470 | + import mock |
471 | import testtools |
472 | from autopilot import testcase as autopilot_testcase |
473 | from testtools.matchers import Contains, Not, FileExists |
474 | |
475 | === modified file 'tests/qmlapicheck.py' |
476 | --- tests/qmlapicheck.py 2013-12-11 11:28:29 +0000 |
477 | +++ tests/qmlapicheck.py 2014-02-28 17:59:31 +0000 |
478 | @@ -1,4 +1,4 @@ |
479 | -#!/usr/bin/env python |
480 | +#!/usr/bin/env python3 |
481 | # -*- coding: utf-8 -*- |
482 | # |
483 | # Copyright 2013 Canonical Ltd. |
484 | @@ -65,7 +65,9 @@ |
485 | fileinput.nextfile() |
486 | |
487 | inputfiles.sort() |
488 | -for line in fileinput.input(inputfiles): |
489 | + |
490 | +hook = fileinput.hook_encoded('utf-8') |
491 | +for line in fileinput.input(inputfiles, openhook=hook): |
492 | # New file |
493 | if fileinput.isfirstline(): |
494 | in_block = 0 |
495 | |
496 | === added file 'tests/qmlapicheck.sh' |
497 | --- tests/qmlapicheck.sh 1970-01-01 00:00:00 +0000 |
498 | +++ tests/qmlapicheck.sh 2014-02-28 17:59:31 +0000 |
499 | @@ -0,0 +1,52 @@ |
500 | +#!/usr/bin/env sh |
501 | +# |
502 | +# Copyright 2013 Canonical Ltd. |
503 | +# |
504 | +# This program is free software; you can redistribute it and/or modify |
505 | +# it under the terms of the GNU Lesser General Public License as published by |
506 | +# the Free Software Foundation; version 3. |
507 | +# |
508 | +# This program is distributed in the hope that it will be useful, |
509 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
510 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
511 | +# GNU Lesser General Public License for more details. |
512 | +# |
513 | +# You should have received a copy of the GNU Lesser General Public License |
514 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
515 | +# |
516 | +################################################################################ |
517 | +QML="modules/Ubuntu/*/qmldir modules/Ubuntu/Components/Colors/UbuntuColors.qml modules/Ubuntu/Components/*/qmldir modules/Ubuntu/Components/Pickers/PickerPanel.qml" |
518 | +CPP="Ubuntu.Components Ubuntu.Layouts Ubuntu.PerformanceMetrics" |
519 | + |
520 | +echo Dumping QML API of C++ components |
521 | +echo '' > plugins.qmltypes |
522 | +for i in $CPP; do |
523 | + # Silence spam on stderr due to fonts |
524 | + # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999 |
525 | + # https://bugreports.qt-project.org/browse/QTBUG-36243 |
526 | + qmlplugindump $i 0.1 modules 2>/dev/null >> plugins.qmltypes |
527 | +done |
528 | +STATUS=$? |
529 | +test $STATUS = 0 || ERRORS=1 |
530 | +test $STATUS = 0 || echo $RESULTS |
531 | + |
532 | +echo Running QML API check for $QML |
533 | +# Palette gets included in Qt 5.2 qmlplugindump even though it's qml |
534 | +BUILTINS=QQuick,QQml,U1db::,Palette python3 tests/qmlapicheck.py $QML plugins.qmltypes > components.api.new |
535 | +STATUS=$? |
536 | +test $STATUS = 0 || ERRORS=1 |
537 | +test $STATUS = 0 || echo $RESULTS |
538 | + |
539 | +echo Verifying the diff between existing and generated API |
540 | +diff -Fqml -u components.api components.api.new |
541 | +STATUS=$? |
542 | +test $STATUS = 0 || ERRORS=1 |
543 | +test $STATUS = 0 || echo $RESULTS |
544 | + |
545 | +if [ "x$ERRORS" != "x1" ]; then |
546 | + echo API is all fine. |
547 | + exit 0 |
548 | +else |
549 | + echo API test failed with errors. Did you forget to update components.api? |
550 | + exit 1 |
551 | +fi |
552 | |
553 | === modified file 'tests/tests.pro' |
554 | --- tests/tests.pro 2013-10-30 11:35:57 +0000 |
555 | +++ tests/tests.pro 2014-02-28 17:59:31 +0000 |
556 | @@ -1,7 +1,10 @@ |
557 | TEMPLATE = subdirs |
558 | SUBDIRS += unit unit_x11 |
559 | |
560 | -autopilot_module.path = /usr/lib/python2.7/dist-packages/ubuntuuitoolkit |
561 | +autopilot_module.path = /usr/lib/python3/dist-packages/ubuntuuitoolkit |
562 | autopilot_module.files = autopilot/ubuntuuitoolkit/* |
563 | |
564 | -INSTALLS += autopilot_module |
565 | +autopilot2_module.path = /usr/lib/python2.7/dist-packages/ubuntuuitoolkit |
566 | +autopilot2_module.files = autopilot/ubuntuuitoolkit/* |
567 | + |
568 | +INSTALLS += autopilot_module autopilot2_module |
569 | |
570 | === modified file 'tests/unit/add_qmlmakecheck.pri' |
571 | --- tests/unit/add_qmlmakecheck.pri 2014-02-11 12:42:55 +0000 |
572 | +++ tests/unit/add_qmlmakecheck.pri 2014-02-28 17:59:31 +0000 |
573 | @@ -8,11 +8,5 @@ |
574 | check.commands += ../../unit/runtest.sh $${TARGET} $${TEST} minimal; |
575 | } |
576 | check.commands += cd ../../..; |
577 | -# Silence spam on stderr due to fonts |
578 | -# https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999 |
579 | -# https://bugreports.qt-project.org/browse/QTBUG-36243 |
580 | -check.commands += qmlplugindump Ubuntu.Components 0.1 modules 2>/dev/null > plugins.qmltypes; |
581 | -check.commands += qmlplugindump Ubuntu.PerformanceMetrics 0.1 modules 2>/dev/null >> plugins.qmltypes; |
582 | -# Palette gets included in Qt 5.2 qmlplugindump even though it's qml |
583 | -check.commands += BUILTINS=QQuick,QQml,U1db::,Palette python tests/qmlapicheck.py modules/Ubuntu/Components/qmldir modules/Ubuntu/Components/Colors/UbuntuColors.qml modules/Ubuntu/Components/Pickers/PickerPanel.qml modules/Ubuntu/Components/*/qmldir modules/Ubuntu/PerformanceMetrics/qmldir plugins.qmltypes > components.api.new; |
584 | -check.commands += diff -Fqml -u components.api components.api.new || exit 1; cd tests/unit |
585 | +check.commands += sh tests/qmlapicheck.sh || exit 1; |
586 | +check.commands += cd tests/unit |
587 | |
588 | === modified file 'ubuntu-sdk.pro' |
589 | --- ubuntu-sdk.pro 2013-12-12 13:01:56 +0000 |
590 | +++ ubuntu-sdk.pro 2014-02-28 17:59:31 +0000 |
591 | @@ -22,10 +22,15 @@ |
592 | QMAKE_EXTRA_TARGETS += test_api |
593 | |
594 | test_components.target = test-components |
595 | -test_components.commands = cd tests/autopilot; autopilot run ubuntuuitoolkit |
596 | +test_components.commands = cd tests/autopilot; python3 -m autopilot.run run ubuntuuitoolkit |
597 | test_components.depends = modules/ubuntu-ui-toolkit.pro |
598 | QMAKE_EXTRA_TARGETS += test_components |
599 | |
600 | +test_components2.target = test-components2 |
601 | +test_components2.commands = cd tests/autopilot; python2 -m autopilot.run run ubuntuuitoolkit |
602 | +test_components2.depends = modules/ubuntu-ui-toolkit.pro |
603 | +QMAKE_EXTRA_TARGETS += test_components2 |
604 | + |
605 | qmluitests.target = qmluitests |
606 | qmluitests.commands = cd tests/unit_x11; make check |
607 | qmluitests.depends = modules/ubuntu-ui-toolkit.pro |
This branch merges and resolves conflicts between:
* lp:~xnox/ubuntu-ui-toolkit/py32ap
* lp:~kalikiana/ubuntu-ui-toolkit/qmlapicheckverbose
* lp:~elopio/ubuntu-ui-toolkit/listview-scroll_to_bottom