Merge lp:~paulliu/unity/phablet-add_unit_test into lp:unity/phablet
- phablet-add_unit_test
- Merge into phablet
Status: | Merged |
---|---|
Approved by: | Michael Zanetti |
Approved revision: | no longer in the source branch. |
Merged at revision: | 601 |
Proposed branch: | lp:~paulliu/unity/phablet-add_unit_test |
Merge into: | lp:unity/phablet |
Diff against target: |
86 lines (+72/-0) 2 files modified
tests/unittests/Components/CMakeLists.txt (+1/-0) tests/unittests/Components/tst_OpenEffect.qml (+71/-0) |
To merge this branch: | bzr merge lp:~paulliu/unity/phablet-add_unit_test |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Zanetti (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Michał Sawicz | Needs Fixing | ||
Albert Astals Cid (community) | Needs Fixing | ||
Review via email: mp+156859@code.launchpad.net |
Commit message
Add unittests for Components/
Description of the change
Add unittests for Components/
PS Jenkins bot (ps-jenkins) wrote : | # |
Daniel d'Andrada (dandrader) wrote : | # |
I don't have a good feeling about this: Writing this entire file to test a single expression (a single line of code) in OpenEffect.qml
Albert Astals Cid (aacid) wrote : | # |
I'm with Daniel, the test does indeed feel a bit weird, but on the other hand it is actually doing some testing...
Michael Zanetti (mzanetti) wrote : | # |
IMO it would be better to have only one OpenEffect element and use multiple test functions to change the gap and check if the others adapt accordingly.
This test only checks if the properties are initilized correctly but not if they also reflect changes during runtime.
Albert Astals Cid (aacid) wrote : | # |
Doesn't merge properly with master
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:534
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:534
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:534
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:534
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:534
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:534
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:534
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:578
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Michał Sawicz (saviq) wrote : | # |
You have a trailing whitespace on line 60 of tst_OpenEffect.qml
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:588
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:588
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michael Zanetti (mzanetti) wrote : | # |
lets get this in
Preview Diff
1 | === modified file 'tests/unittests/Components/CMakeLists.txt' | |||
2 | --- tests/unittests/Components/CMakeLists.txt 2013-04-08 17:08:40 +0000 | |||
3 | +++ tests/unittests/Components/CMakeLists.txt 2013-04-12 12:04:26 +0000 | |||
4 | @@ -2,5 +2,6 @@ | |||
5 | 2 | add_qml_test(Carousel) | 2 | add_qml_test(Carousel) |
6 | 3 | add_qml_test(CrossFadeImage) | 3 | add_qml_test(CrossFadeImage) |
7 | 4 | add_qml_test(MathLocal) | 4 | add_qml_test(MathLocal) |
8 | 5 | add_qml_test(OpenEffect) | ||
9 | 5 | add_qml_test(RatingStars) | 6 | add_qml_test(RatingStars) |
10 | 6 | add_qml_test(TimeLocal) | 7 | add_qml_test(TimeLocal) |
11 | 7 | 8 | ||
12 | === added file 'tests/unittests/Components/tst_OpenEffect.qml' | |||
13 | --- tests/unittests/Components/tst_OpenEffect.qml 1970-01-01 00:00:00 +0000 | |||
14 | +++ tests/unittests/Components/tst_OpenEffect.qml 2013-04-12 12:04:26 +0000 | |||
15 | @@ -0,0 +1,71 @@ | |||
16 | 1 | /* | ||
17 | 2 | * Copyright 2013 Canonical Ltd. | ||
18 | 3 | * | ||
19 | 4 | * This program is free software; you can redistribute it and/or modify | ||
20 | 5 | * it under the terms of the GNU General Public License as published by | ||
21 | 6 | * the Free Software Foundation; version 3. | ||
22 | 7 | * | ||
23 | 8 | * This program is distributed in the hope that it will be useful, | ||
24 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
25 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
26 | 11 | * GNU General Public License for more details. | ||
27 | 12 | * | ||
28 | 13 | * You should have received a copy of the GNU General Public License | ||
29 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
30 | 15 | */ | ||
31 | 16 | |||
32 | 17 | import QtQuick 2.0 | ||
33 | 18 | import QtTest 1.0 | ||
34 | 19 | import "../../../Components" | ||
35 | 20 | |||
36 | 21 | TestCase { | ||
37 | 22 | name: "OpenEffectTest" | ||
38 | 23 | |||
39 | 24 | function test_openeffect_enabled() { | ||
40 | 25 | compare(openEffect1.enabled, true, "OpenEffect should be enabled if gap is greather than 0.0") | ||
41 | 26 | } | ||
42 | 27 | |||
43 | 28 | function test_openeffect_shadereffectsource() { | ||
44 | 29 | compare(openEffect1.source.hideSource, true, "OpenEffect ShaderEffectSource is incorrect") | ||
45 | 30 | compare(openEffect1.source.sourceItem, rectangle2, "OpenEffect ShaderEffectSource is incorrect") | ||
46 | 31 | compare(openEffect1.source.live, true, "OpenEffect ShaderEffectSource is incorrect") | ||
47 | 32 | compare(openEffect1.source.sourceRect.x, 0, "OpenEffect ShaderEffectSource is incorrect") | ||
48 | 33 | compare(openEffect1.source.sourceRect.y, 0, "OpenEffect ShaderEffectSource is incorrect") | ||
49 | 34 | compare(openEffect1.source.sourceRect.width, 50, "OpenEffect ShaderEffectSource is incorrect") | ||
50 | 35 | compare(openEffect1.source.sourceRect.height, 71, "OpenEffect ShaderEffectSource is incorrect") | ||
51 | 36 | openEffect1.gap=2.0 | ||
52 | 37 | compare(openEffect1.source.sourceRect.x, 0, "OpenEffect ShaderEffectSource is incorrect") | ||
53 | 38 | compare(openEffect1.source.sourceRect.y, 0, "OpenEffect ShaderEffectSource is incorrect") | ||
54 | 39 | compare(openEffect1.source.sourceRect.width, 50, "OpenEffect ShaderEffectSource is incorrect") | ||
55 | 40 | compare(openEffect1.source.sourceRect.height, 72, "OpenEffect ShaderEffectSource is incorrect") | ||
56 | 41 | } | ||
57 | 42 | |||
58 | 43 | Rectangle { | ||
59 | 44 | id: rectangle1 | ||
60 | 45 | |||
61 | 46 | width: 100; height: 100 | ||
62 | 47 | |||
63 | 48 | Rectangle { | ||
64 | 49 | id: rectangle2 | ||
65 | 50 | width: 50; height: 50 | ||
66 | 51 | } | ||
67 | 52 | |||
68 | 53 | OpenEffect { | ||
69 | 54 | id: openEffect1 | ||
70 | 55 | anchors { | ||
71 | 56 | fill: parent | ||
72 | 57 | } | ||
73 | 58 | |||
74 | 59 | property real gap: 1.0 | ||
75 | 60 | |||
76 | 61 | topGapPx: (1 - gap) * positionPx | ||
77 | 62 | topOpacity: (1 - gap * 1.2) | ||
78 | 63 | bottomGapPx: positionPx + gap * 10 | ||
79 | 64 | bottomOverflow: 20 + gap | ||
80 | 65 | bottomOpacity: 1 - (gap * 0.8) | ||
81 | 66 | |||
82 | 67 | positionPx: gap | ||
83 | 68 | sourceItem: rectangle2 | ||
84 | 69 | } | ||
85 | 70 | } | ||
86 | 71 | } |
PASSED: Continuous integration, rev:531 jenkins. qa.ubuntu. com/job/ unity-phablet- ci/240/ jenkins. qa.ubuntu. com/job/ unity-phablet- quantal- armhf-ci/ 241 jenkins. qa.ubuntu. com/job/ unity-phablet- quantal- armhf-ci/ 241/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ unity-phablet- quantal- i386-ci/ 240 jenkins. qa.ubuntu. com/job/ unity-phablet- raring- armhf-ci/ 116 jenkins. qa.ubuntu. com/job/ unity-phablet- raring- armhf-ci/ 116/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ unity-phablet- raring- i386-ci/ 116 jenkins. qa.ubuntu. com/job/ generic- mediumtests- runner/ 592
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins: 8080/job/ unity-phablet- ci/240/ rebuild
http://