Merge lp:~xnox/ubuntu-ui-toolkit/py32ap+listview-scroll_to_bottom+qmlapicheckverbose into lp:ubuntu-ui-toolkit

Proposed by Dimitri John Ledkov
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
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.

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Unmerged revisions

956. By Dimitri John Ledkov

Merge lp:~kalikiana/ubuntu-ui-toolkit/qmlapicheckverbose

955. By Dimitri John Ledkov

Merge lp:~elopio/ubuntu-ui-toolkit/listview-scroll_to_bottom

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'components.api'
--- components.api 2014-02-13 17:22:21 +0000
+++ components.api 2014-02-28 17:59:31 +0000
@@ -566,6 +566,11 @@
566modules/Ubuntu/PerformanceMetrics/PerformanceOverlay.qml566modules/Ubuntu/PerformanceMetrics/PerformanceOverlay.qml
567Item567Item
568 property bool active568 property bool active
569modules/Ubuntu/Test/UbuntuTestCase.qml
570TestCase
571 function findChild(obj,objectName)
572 function findInvisibleChild(obj,objectName)
573 function mouseMoveSlowly(item,x,y,dx,dy,steps,stepdelay)
569plugins.qmltypes574plugins.qmltypes
570 name: "InverseMouseAreaType"575 name: "InverseMouseAreaType"
571 prototype: "QQuickMouseArea"576 prototype: "QQuickMouseArea"
@@ -750,6 +755,24 @@
750 Parameter { name: "singular"; type: "string" }755 Parameter { name: "singular"; type: "string" }
751 Parameter { name: "plural"; type: "string" }756 Parameter { name: "plural"; type: "string" }
752 Parameter { name: "n"; type: "int" }757 Parameter { name: "n"; type: "int" }
758 name: "ULConditionalLayout"
759 prototype: "QObject"
760 exports: ["ConditionalLayout 0.1"]
761 Property { name: "name"; type: "string" }
762 Property { name: "when"; type: "QQmlBinding"; isPointer: true }
763 Property { name: "layout"; type: "QQmlComponent"; isPointer: true }
764 name: "ULItemLayout"
765 prototype: "QQuickItem"
766 exports: ["ItemLayout 0.1"]
767 Property { name: "item"; type: "string" }
768 name: "ULLayouts"
769 prototype: "QQuickItem"
770 exports: ["Layouts 0.1"]
771 Property { name: "currentLayout"; type: "string"; isReadonly: true }
772 Property { name: "layouts"; type: "ULConditionalLayout"; isList: true; isReadonly: true }
773 name: "ULLayoutsAttached"
774 prototype: "QObject"
775 Property { name: "item"; type: "string" }
753 name: "UPMCpuUsage"776 name: "UPMCpuUsage"
754 prototype: "QQuickItem"777 prototype: "QQuickItem"
755 exports: ["CpuUsage 0.1"]778 exports: ["CpuUsage 0.1"]
756779
=== modified file 'debian/control'
--- debian/control 2014-02-12 09:20:43 +0000
+++ debian/control 2014-02-28 17:59:31 +0000
@@ -6,6 +6,7 @@
6 devscripts,6 devscripts,
7 libgles2-mesa-dev,7 libgles2-mesa-dev,
8 libglib2.0-dev,8 libglib2.0-dev,
9 python3,
9 python,10 python,
10 libqt5qml-graphicaleffects | libqt5graphicaleffects5,11 libqt5qml-graphicaleffects | libqt5graphicaleffects5,
11 qt5-default,12 qt5-default,
@@ -22,12 +23,12 @@
22 qtdeclarative5-qtfeedback-plugin,23 qtdeclarative5-qtfeedback-plugin,
23 qtdeclarative5-unity-action-plugin (>= 1.1.0),24 qtdeclarative5-unity-action-plugin (>= 1.1.0),
24 qtdeclarative5-localstorage-plugin,25 qtdeclarative5-localstorage-plugin,
25 qtdeclarative5-doc-html,26 qtdeclarative5-doc-html,
26 qtwebkit5-doc-html,27 qtwebkit5-doc-html,
27 qtsvg5-doc-html,28 qtsvg5-doc-html,
28 qtscript5-doc-html,29 qtscript5-doc-html,
29 qtmultimedia5-doc-html,30 qtmultimedia5-doc-html,
30 unity-action-doc,31 unity-action-doc,
31 devscripts,32 devscripts,
32 libqt5organizer5,33 libqt5organizer5,
33 qtpim5-dev,34 qtpim5-dev,
@@ -133,6 +134,8 @@
133 python-autopilot (>= 1.4),134 python-autopilot (>= 1.4),
134 python-fixtures,135 python-fixtures,
135 python-mock,136 python-mock,
137 python3-fixtures,
138 python3-autopilot (>= 1.4),
136 ubuntu-ui-toolkit-examples (>= ${source:Version}),139 ubuntu-ui-toolkit-examples (>= ${source:Version}),
137Description: Test package for Ubuntu UI Toolkit140Description: Test package for Ubuntu UI Toolkit
138 Autopilot tests for the ubuntu-ui-toolkit package141 Autopilot tests for the ubuntu-ui-toolkit package
139142
=== modified file 'debian/rules'
--- debian/rules 2014-01-22 16:25:25 +0000
+++ debian/rules 2014-02-28 17:59:31 +0000
@@ -11,6 +11,7 @@
11override_dh_auto_test:11override_dh_auto_test:
12ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))12ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
13 mkdir -p debian/tmp/home/run13 mkdir -p debian/tmp/home/run
14 chmod +x tests/xvfb.sh
14 tests/xvfb.sh dh_auto_test || exit $?15 tests/xvfb.sh dh_auto_test || exit $?
15endif16endif
1617
1718
=== modified file 'debian/ubuntu-ui-toolkit-autopilot.install'
--- debian/ubuntu-ui-toolkit-autopilot.install 2013-10-30 11:35:57 +0000
+++ debian/ubuntu-ui-toolkit-autopilot.install 2014-02-28 17:59:31 +0000
@@ -1,1 +1,2 @@
1usr/lib/python2.7/dist-packages/ubuntuuitoolkit1usr/lib/python3
2usr/lib/python2.7
23
=== modified file 'run_tests.sh'
--- run_tests.sh 2013-07-23 22:15:05 +0000
+++ run_tests.sh 2014-02-28 17:59:31 +0000
@@ -20,9 +20,9 @@
20echo running with arg: $120echo running with arg: $1
2121
22if [ "$1" == "" ]; then22if [ "$1" == "" ]; then
23 autopilot run ubuntuuitoolkit23 python3 -m autopilot.run run ubuntuuitoolkit
24else24else
25 autopilot run -o ../../$1 -f xml -r -rd ../../ ubuntuuitoolkit25 python3 -m autopilot.run run -o ../../$1 -f xml -r -rd ../../ ubuntuuitoolkit
26fi26fi
2727
28exit 028exit 0
2929
=== modified file 'tests/autopilot/ubuntuuitoolkit/base.py'
--- tests/autopilot/ubuntuuitoolkit/base.py 2013-11-15 05:11:10 +0000
+++ tests/autopilot/ubuntuuitoolkit/base.py 2014-02-28 17:59:31 +0000
@@ -31,8 +31,9 @@
31 # configuration on devices and it seems the environment variable31 # configuration on devices and it seems the environment variable
32 # QT_SELECT=qt5 doesn't work for autopilot tests. --Mirv - 2013-10-0332 # QT_SELECT=qt5 doesn't work for autopilot tests. --Mirv - 2013-10-03
33 arch = subprocess.check_output(33 arch = subprocess.check_output(
34 ["dpkg-architecture", "-qDEB_HOST_MULTIARCH"]).strip()34 ["dpkg-architecture", "-qDEB_HOST_MULTIARCH"],
35 return '/usr/lib/{}/qt5/bin/qmlscene'.format(arch.decode())35 universal_newlines=True).strip()
36 return '/usr/lib/{}/qt5/bin/qmlscene'.format(arch)
3637
3738
38class UbuntuUIToolkitAppTestCase(testcase.AutopilotTestCase):39class UbuntuUIToolkitAppTestCase(testcase.AutopilotTestCase):
3940
=== modified file 'tests/autopilot/ubuntuuitoolkit/emulators.py'
--- tests/autopilot/ubuntuuitoolkit/emulators.py 2014-01-30 15:26:21 +0000
+++ tests/autopilot/ubuntuuitoolkit/emulators.py 2014-02-28 17:59:31 +0000
@@ -15,7 +15,6 @@
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17import logging17import logging
18import time
19from distutils import version18from distutils import version
2019
21import autopilot20import autopilot
@@ -527,7 +526,7 @@
527 def click_element(self, objectName):526 def click_element(self, objectName):
528 """Click an element from the list.527 """Click an element from the list.
529528
530 It swipes the element into view if it's not fully visible.529 It swipes the element into view if it's center is not visible.
531530
532 :parameter objectName: The objectName property of the element to click.531 :parameter objectName: The objectName property of the element to click.
533532
@@ -537,38 +536,81 @@
537 self.pointing_device.click_object(element)536 self.pointing_device.click_object(element)
538537
539 def _swipe_element_into_view(self, objectName):538 def _swipe_element_into_view(self, objectName):
540 element = self.select_single(objectName=objectName)539 element = self._select_element(objectName)
541 x, y, width, height = self.globalRect
542 start_x = x + (width / 2)
543 start_y = y + (height / 2)
544540
545 while not self._is_element_fully_visible(objectName):541 while not self._is_element_clickable(objectName):
546 stop_x = start_x
547 if element.globalRect.y < self.globalRect.y:542 if element.globalRect.y < self.globalRect.y:
548 stop_y = start_y + element.implicitHeight543 self._show_more_elements_above()
549 else:544 else:
550 stop_y = start_y - element.implicitHeight545 self._show_more_elements_below()
551546
552 if platform.model() == 'Desktop':547 def _select_element(self, object_name):
553 # The drag on the desktop is done two fast, so we are left at548 try:
554 # the bottom or at the top of the list, sometimes missing the549 return self.select_single(objectName=object_name)
555 # element we are looking for.550 except dbus.StateNotFoundError:
556 # TODO: use the slow drag once it's implemented:551 # If the list is big, elements will only be created when we scroll
557 # https://bugs.launchpad.net/autopilot/+bug/1257055552 # them into view.
558 # --elopio - 2014-01-09553 self._scroll_to_top()
559 self.pointing_device.move(start_x, start_y)554 while not self.atYEnd:
560 self.pointing_device.press()555 self._show_more_elements_below()
561 self.pointing_device.move(stop_x, stop_y)556 try:
562 time.sleep(0.3)557 return self.select_single(objectName=object_name)
563 self.pointing_device.release()558 except dbus.StateNotFoundError:
564 else:559 pass
565 self.pointing_device.drag(start_x, start_y, stop_x, stop_y)560 raise ToolkitEmulatorException(
566561 'List element with objectName "{}" not found.'.format(
567 def _is_element_fully_visible(self, objectName):562 object_name))
563
564 @autopilot_logging.log_action(logger.info)
565 def _scroll_to_top(self):
566 x, y, width, height = self.globalRect
567 while not self.atYBeginning:
568 self._show_more_elements_above()
569
570 @autopilot_logging.log_action(logger.info)
571 def _show_more_elements_below(self):
572 if self.atYEnd:
573 raise ToolkitEmulatorException('There are no more elements below.')
574 else:
575 self._show_more_elements('below')
576
577 @autopilot_logging.log_action(logger.info)
578 def _show_more_elements_above(self):
579 if self.atYBeginning:
580 raise ToolkitEmulatorException('There are no more elements above.')
581 else:
582 self._show_more_elements('above')
583
584 def _show_more_elements(self, direction):
585 x, y, width, height = self.globalRect
586 start_x = stop_x = x + (width // 2)
587 # Start and stop just a little under the top of the list.
588 top = y + 5
589 bottom = y + height - 5
590 if direction == 'below':
591 start_y = bottom
592 stop_y = top
593 elif direction == 'above':
594 start_y = top
595 stop_y = bottom
596 else:
597 raise ToolkitEmulatorException(
598 'Invalid direction {}.'.format(direction))
599 self._slow_drag(start_x, stop_x, start_y, stop_y)
600 self.dragging.wait_for(False)
601 self.moving.wait_for(False)
602
603 def _slow_drag(self, start_x, stop_x, start_y, stop_y):
604 # If we drag too fast, we end up scrolling more than what we
605 # should, sometimes missing the element we are looking for.
606 self.pointing_device.drag(start_x, start_y, stop_x, stop_y, rate=5)
607
608 def _is_element_clickable(self, objectName):
609 """Return True if the center of the element is visible."""
568 element = self.select_single(objectName=objectName)610 element = self.select_single(objectName=objectName)
569 return (element.globalRect.y >= self.globalRect.y and611 element_center = element.globalRect.y + element.globalRect.height // 2
570 element.globalRect.y + element.globalRect.height <=612 return (element_center >= self.globalRect.y and
571 self.globalRect.y + self.globalRect.height)613 element_center <= self.globalRect.y + self.globalRect.height)
572614
573615
574class Empty(UbuntuUIToolkitEmulatorBase):616class Empty(UbuntuUIToolkitEmulatorBase):
@@ -587,7 +629,7 @@
587 @autopilot_logging.log_action(logger.info)629 @autopilot_logging.log_action(logger.info)
588 def swipe_to_delete(self, direction='right'):630 def swipe_to_delete(self, direction='right'):
589 """Swipe the item in a specific direction."""631 """Swipe the item in a specific direction."""
590 if (self.removable):632 if self.removable:
591 self._drag_pointing_device_to_delete(direction)633 self._drag_pointing_device_to_delete(direction)
592 if self.confirmRemoval:634 if self.confirmRemoval:
593 self.waitingConfirmationForRemoval.wait_for(True)635 self.waitingConfirmationForRemoval.wait_for(True)
@@ -599,12 +641,12 @@
599641
600 def _drag_pointing_device_to_delete(self, direction):642 def _drag_pointing_device_to_delete(self, direction):
601 x, y, w, h = self.globalRect643 x, y, w, h = self.globalRect
602 tx = x + (w / 8)644 tx = x + (w // 8)
603 ty = y + (h / 2)645 ty = y + (h // 2)
604646
605 if (direction == 'right'):647 if direction == 'right':
606 self.pointing_device.drag(tx, ty, w, ty)648 self.pointing_device.drag(tx, ty, w, ty)
607 elif (direction == 'left'):649 elif direction == 'left':
608 self.pointing_device.drag(w - (w*0.1), ty, x, ty)650 self.pointing_device.drag(w - (w*0.1), ty, x, ty)
609 else:651 else:
610 raise ToolkitEmulatorException(652 raise ToolkitEmulatorException(
@@ -622,7 +664,7 @@
622 @autopilot_logging.log_action(logger.info)664 @autopilot_logging.log_action(logger.info)
623 def confirm_removal(self):665 def confirm_removal(self):
624 """Comfirm item removal if this was already swiped."""666 """Comfirm item removal if this was already swiped."""
625 if (self.waitingConfirmationForRemoval):667 if self.waitingConfirmationForRemoval:
626 deleteButton = self._get_confirm_button()668 deleteButton = self._get_confirm_button()
627 self.pointing_device.click_object(deleteButton)669 self.pointing_device.click_object(deleteButton)
628 self._wait_until_deleted()670 self._wait_until_deleted()
629671
=== modified file 'tests/autopilot/ubuntuuitoolkit/fixture_setup.py'
--- tests/autopilot/ubuntuuitoolkit/fixture_setup.py 2014-02-12 09:20:43 +0000
+++ tests/autopilot/ubuntuuitoolkit/fixture_setup.py 2014-02-28 17:59:31 +0000
@@ -87,7 +87,7 @@
87 qmlscene=base.get_qmlscene_launch_command(),87 qmlscene=base.get_qmlscene_launch_command(),
88 qml_file_path=qml_file_path))88 qml_file_path=qml_file_path))
89 desktop_file.write('[Desktop Entry]\n')89 desktop_file.write('[Desktop Entry]\n')
90 for key, value in self._desktop_file_dict.iteritems():90 for key, value in self._desktop_file_dict.items():
91 desktop_file.write('{key}={value}\n'.format(key=key, value=value))91 desktop_file.write('{key}={value}\n'.format(key=key, value=value))
92 desktop_file.close()92 desktop_file.close()
93 return desktop_file.name93 return desktop_file.name
9494
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/test_emulators.py'
--- tests/autopilot/ubuntuuitoolkit/tests/test_emulators.py 2014-01-13 15:23:25 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/test_emulators.py 2014-02-28 17:59:31 +0000
@@ -14,7 +14,6 @@
14# You should have received a copy of the GNU Lesser General Public License14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17import mock
18import time17import time
19import unittest18import unittest
2019
@@ -22,6 +21,10 @@
22from autopilot import input, platform21from autopilot import input, platform
23from autopilot.introspection import dbus22from autopilot.introspection import dbus
24from testtools.matchers import GreaterThan, LessThan23from testtools.matchers import GreaterThan, LessThan
24try:
25 from unittest import mock
26except ImportError:
27 import mock
2528
26from ubuntuuitoolkit import emulators, tests29from ubuntuuitoolkit import emulators, tests
2730
@@ -574,47 +577,6 @@
574 text: "No element clicked."577 text: "No element clicked."
575 }578 }
576579
577 ListModel {
578 id: testModel
579
580 ListElement {
581 objectName: "testListElement1"
582 label: "test list element 1"
583 }
584 ListElement {
585 objectName: "testListElement2"
586 label: "test list element 2"
587 }
588 ListElement {
589 objectName: "testListElement3"
590 label: "test list element 3"
591 }
592 ListElement {
593 objectName: "testListElement4"
594 label: "test list element 4"
595 }
596 ListElement {
597 objectName: "testListElement5"
598 label: "test list element 5"
599 }
600 ListElement {
601 objectName: "testListElement6"
602 label: "test list element 6"
603 }
604 ListElement {
605 objectName: "testListElement7"
606 label: "test list element 7"
607 }
608 ListElement {
609 objectName: "testListElement8"
610 label: "test list element 8"
611 }
612 ListElement {
613 objectName: "testListElement9"
614 label: "test list element 9"
615 }
616 }
617
618 ListView {580 ListView {
619 id: testListView581 id: testListView
620 objectName: "testListView"582 objectName: "testListView"
@@ -622,13 +584,13 @@
622 anchors.right: parent.right584 anchors.right: parent.right
623 height: column.height - clickedLabel.paintedHeight585 height: column.height - clickedLabel.paintedHeight
624 clip: true586 clip: true
625 model: testModel587 model: 20
626588
627 delegate: ListItem.Standard {589 delegate: ListItem.Standard {
628 text: model.label590 objectName: "testListElement%1".arg(index)
629 objectName: model.objectName591 text: "test list element %1".arg(index)
630 onClicked: clickedLabel.text = model.objectName592 onClicked: clickedLabel.text = objectName
631 height: units.gu(5)593 height: units.gu(5)
632 }594 }
633 }595 }
634 }596 }
@@ -648,32 +610,45 @@
648 self.assertIsInstance(self.list_view, emulators.QQuickListView)610 self.assertIsInstance(self.list_view, emulators.QQuickListView)
649611
650 def test_click_element(self):612 def test_click_element(self):
651 self.list_view.click_element('testListElement1')613 self.list_view.click_element('testListElement0')
652 self.assertEqual(self.label.text, 'testListElement1')614 self.assertEqual(self.label.text, 'testListElement0')
653615
654 def test_click_element_outside_view_below(self):616 def test_click_element_outside_view_below(self):
655 # Click the first element out of view to make sure we are not scrolling617 # Click the first element out of view to make sure we are not scrolling
656 # to the bottom at once.618 # to the bottom at once.
657 self.assertFalse(619 self.assertFalse(
658 self.list_view._is_element_fully_visible('testListElement5'))620 self.list_view._is_element_clickable('testListElement5'))
659621
660 self.list_view.click_element('testListElement5')622 self.list_view.click_element('testListElement5')
661 self.assertEqual(self.label.text, 'testListElement5')623 self.assertEqual(self.label.text, 'testListElement5')
662624
663 def test_click_element_outside_view_above(self):625 def test_click_element_outside_view_above(self):
664 # First we need to scroll to the 8th element in order for the 9th to be
665 # created.
666 self.list_view.click_element('testListElement8')
667 self.list_view.click_element('testListElement9')626 self.list_view.click_element('testListElement9')
668627
669 # Click the first element out of view to make sure we are not scrolling628 # Click the first element out of view to make sure we are not scrolling
670 # to the top at once.629 # to the top at once.
671 self.assertFalse(630 self.assertFalse(
672 self.list_view._is_element_fully_visible('testListElement4'))631 self.list_view._is_element_clickable('testListElement4'))
673632
674 self.list_view.click_element('testListElement4')633 self.list_view.click_element('testListElement4')
675 self.assertEqual(self.label.text, 'testListElement4')634 self.assertEqual(self.label.text, 'testListElement4')
676635
636 def test_click_element_not_created_at_start(self):
637 objectName = 'testListElement19'
638 self.assertRaises(
639 dbus.StateNotFoundError,
640 self.list_view.select_single,
641 objectName=objectName)
642 self.list_view.click_element(objectName)
643
644 def test_click_unexisting_element(self):
645 error = self.assertRaises(
646 emulators.ToolkitEmulatorException,
647 self.list_view.click_element,
648 'unexisting')
649 self.assertEqual(
650 str(error), 'List element with objectName "unexisting" not found.')
651
677652
678class SwipeToDeleteTestCase(tests.QMLStringAppTestCase):653class SwipeToDeleteTestCase(tests.QMLStringAppTestCase):
679654
680655
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py'
--- tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py 2014-02-12 18:41:20 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py 2014-02-28 17:59:31 +0000
@@ -16,7 +16,12 @@
1616
17import os17import os
1818
19import mock19try:
20 # Python 3.
21 from unittest import mock
22except ImportError:
23 # Python 2 add-on: python-mock.
24 import mock
20import testtools25import testtools
21from autopilot import testcase as autopilot_testcase26from autopilot import testcase as autopilot_testcase
22from testtools.matchers import Contains, Not, FileExists27from testtools.matchers import Contains, Not, FileExists
2328
=== modified file 'tests/qmlapicheck.py'
--- tests/qmlapicheck.py 2013-12-11 11:28:29 +0000
+++ tests/qmlapicheck.py 2014-02-28 17:59:31 +0000
@@ -1,4 +1,4 @@
1#!/usr/bin/env python1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-2# -*- coding: utf-8 -*-
3#3#
4# Copyright 2013 Canonical Ltd.4# Copyright 2013 Canonical Ltd.
@@ -65,7 +65,9 @@
65 fileinput.nextfile()65 fileinput.nextfile()
6666
67inputfiles.sort()67inputfiles.sort()
68for line in fileinput.input(inputfiles):68
69hook = fileinput.hook_encoded('utf-8')
70for line in fileinput.input(inputfiles, openhook=hook):
69 # New file71 # New file
70 if fileinput.isfirstline():72 if fileinput.isfirstline():
71 in_block = 073 in_block = 0
7274
=== added file 'tests/qmlapicheck.sh'
--- tests/qmlapicheck.sh 1970-01-01 00:00:00 +0000
+++ tests/qmlapicheck.sh 2014-02-28 17:59:31 +0000
@@ -0,0 +1,52 @@
1#!/usr/bin/env sh
2#
3# Copyright 2013 Canonical Ltd.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation; version 3.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
16#
17################################################################################
18QML="modules/Ubuntu/*/qmldir modules/Ubuntu/Components/Colors/UbuntuColors.qml modules/Ubuntu/Components/*/qmldir modules/Ubuntu/Components/Pickers/PickerPanel.qml"
19CPP="Ubuntu.Components Ubuntu.Layouts Ubuntu.PerformanceMetrics"
20
21echo Dumping QML API of C++ components
22echo '' > plugins.qmltypes
23for i in $CPP; do
24 # Silence spam on stderr due to fonts
25 # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999
26 # https://bugreports.qt-project.org/browse/QTBUG-36243
27 qmlplugindump $i 0.1 modules 2>/dev/null >> plugins.qmltypes
28done
29STATUS=$?
30test $STATUS = 0 || ERRORS=1
31test $STATUS = 0 || echo $RESULTS
32
33echo Running QML API check for $QML
34# Palette gets included in Qt 5.2 qmlplugindump even though it's qml
35BUILTINS=QQuick,QQml,U1db::,Palette python3 tests/qmlapicheck.py $QML plugins.qmltypes > components.api.new
36STATUS=$?
37test $STATUS = 0 || ERRORS=1
38test $STATUS = 0 || echo $RESULTS
39
40echo Verifying the diff between existing and generated API
41diff -Fqml -u components.api components.api.new
42STATUS=$?
43test $STATUS = 0 || ERRORS=1
44test $STATUS = 0 || echo $RESULTS
45
46if [ "x$ERRORS" != "x1" ]; then
47 echo API is all fine.
48 exit 0
49else
50 echo API test failed with errors. Did you forget to update components.api?
51 exit 1
52fi
053
=== modified file 'tests/tests.pro'
--- tests/tests.pro 2013-10-30 11:35:57 +0000
+++ tests/tests.pro 2014-02-28 17:59:31 +0000
@@ -1,7 +1,10 @@
1TEMPLATE = subdirs1TEMPLATE = subdirs
2SUBDIRS += unit unit_x112SUBDIRS += unit unit_x11
33
4autopilot_module.path = /usr/lib/python2.7/dist-packages/ubuntuuitoolkit4autopilot_module.path = /usr/lib/python3/dist-packages/ubuntuuitoolkit
5autopilot_module.files = autopilot/ubuntuuitoolkit/*5autopilot_module.files = autopilot/ubuntuuitoolkit/*
66
7INSTALLS += autopilot_module7autopilot2_module.path = /usr/lib/python2.7/dist-packages/ubuntuuitoolkit
8autopilot2_module.files = autopilot/ubuntuuitoolkit/*
9
10INSTALLS += autopilot_module autopilot2_module
811
=== modified file 'tests/unit/add_qmlmakecheck.pri'
--- tests/unit/add_qmlmakecheck.pri 2014-02-11 12:42:55 +0000
+++ tests/unit/add_qmlmakecheck.pri 2014-02-28 17:59:31 +0000
@@ -8,11 +8,5 @@
8 check.commands += ../../unit/runtest.sh $${TARGET} $${TEST} minimal;8 check.commands += ../../unit/runtest.sh $${TARGET} $${TEST} minimal;
9}9}
10check.commands += cd ../../..;10check.commands += cd ../../..;
11# Silence spam on stderr due to fonts11check.commands += sh tests/qmlapicheck.sh || exit 1;
12# https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/125699912check.commands += cd tests/unit
13# https://bugreports.qt-project.org/browse/QTBUG-36243
14check.commands += qmlplugindump Ubuntu.Components 0.1 modules 2>/dev/null > plugins.qmltypes;
15check.commands += qmlplugindump Ubuntu.PerformanceMetrics 0.1 modules 2>/dev/null >> plugins.qmltypes;
16# Palette gets included in Qt 5.2 qmlplugindump even though it's qml
17check.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;
18check.commands += diff -Fqml -u components.api components.api.new || exit 1; cd tests/unit
1913
=== modified file 'ubuntu-sdk.pro'
--- ubuntu-sdk.pro 2013-12-12 13:01:56 +0000
+++ ubuntu-sdk.pro 2014-02-28 17:59:31 +0000
@@ -22,10 +22,15 @@
22QMAKE_EXTRA_TARGETS += test_api22QMAKE_EXTRA_TARGETS += test_api
2323
24test_components.target = test-components24test_components.target = test-components
25test_components.commands = cd tests/autopilot; autopilot run ubuntuuitoolkit25test_components.commands = cd tests/autopilot; python3 -m autopilot.run run ubuntuuitoolkit
26test_components.depends = modules/ubuntu-ui-toolkit.pro26test_components.depends = modules/ubuntu-ui-toolkit.pro
27QMAKE_EXTRA_TARGETS += test_components27QMAKE_EXTRA_TARGETS += test_components
2828
29test_components2.target = test-components2
30test_components2.commands = cd tests/autopilot; python2 -m autopilot.run run ubuntuuitoolkit
31test_components2.depends = modules/ubuntu-ui-toolkit.pro
32QMAKE_EXTRA_TARGETS += test_components2
33
29qmluitests.target = qmluitests34qmluitests.target = qmluitests
30qmluitests.commands = cd tests/unit_x11; make check35qmluitests.commands = cd tests/unit_x11; make check
31qmluitests.depends = modules/ubuntu-ui-toolkit.pro36qmluitests.depends = modules/ubuntu-ui-toolkit.pro

Subscribers

People subscribed via source and target branches

to status/vote changes: