Merge lp:~paulliu/unity/phablet-add_unit_test into lp:unity/phablet

Proposed by Ying-Chun Liu
Status: Merged
Approved by: Michael Zanetti
Approved revision: 588
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
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/OpenEffect.qml

Description of the change

Add unittests for Components/OpenEffect.qml

To post a comment you must log in.
533. By Daniel d'Andrada on 2013-04-03

Added a README file to tests/qmluitests

Have in written form what was verbally agreed.
Helps lower the entry barrier for new developers.

Approved by PS Jenkins bot, Michał Sawicz.

534. By Michał Sawicz on 2013-04-04

fix launching sidestage apps where no sidestage is available.

Approved by PS Jenkins bot, Ricardo Mendoza.

535. By Michał Sawicz on 2013-04-04

add entries needed in the .desktop file and change the name and comment.

Approved by Albert Astals Cid, PS Jenkins bot.

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

536. By Sergio Schvezov on 2013-04-04

Removing mocks for calendar, clock and calculator.

Approved by PS Jenkins bot, Ricardo Salveti.

537. By Sergio Schvezov on 2013-04-05

Releasing 1.69

[ Sergio Schvezov ]
* Removing mocks for calendar, clock and calculator.
[ Michał Sawicz ]
* Add entries needed in the .desktop file and change the name and comment.

Approved by Ricardo Salveti, PS Jenkins bot.

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...

538. By Jussi Pakkanen on 2013-04-05

Get rid of multiple project() calls.

Approved by Albert Astals Cid, PS Jenkins bot.

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.

review: Needs Fixing
539. By Albert Astals Cid on 2013-04-05

Less signals up from the peakDetector

No need to throw up 16000 signals per second, makes everything a slower than we need :D
.

Approved by Michał Sawicz, PS Jenkins bot.

540. By Michael Zanetti on 2013-04-05

Make qmluitests executable on jenkins

- fixes some missing build dependencies that are required to run qmluitests
- adds a script "runtests.sh" that runs the tests, gathers statistics and creates a coverage.xml
- fixes greeter tests.

Approved by Michał Sawicz, PS Jenkins bot, Albert Astals Cid.

541. By Jussi Pakkanen on 2013-04-05

Build in a separate build directory.

Approved by PS Jenkins bot.

542. By Nick Dedekind on 2013-04-05

Added qmluitest for indicator row.

Approved by PS Jenkins bot, Albert Astals Cid.

543. By Albert Astals Cid on 2013-04-05

Follow the binary into the builddir.

Approved by PS Jenkins bot, Nicolas d'Offay, Michał Sawicz.

544. By Daniel d'Andrada on 2013-04-05

Remove dead code from Dash

Installed applications is now taken from a live lens instead of a hardcoded model.

Approved by Michał Sawicz, PS Jenkins bot.

545. By Brandon Schaefer on 2013-04-05

Fixes this error:
Components/OpenEffect.qml:29: TypeError: Cannot read property 'width' of null.

Approved by Michał Sawicz, PS Jenkins bot.

546. By Michi Henning on 2013-04-08

Fixes incorrect linkage for C++ function pointers passed to C API. See bug #1163719. Fixes: https://bugs.launchpad.net/bugs/1163719.

Approved by PS Jenkins bot, Albert Astals Cid.

547. By Michi Henning on 2013-04-08

These changes fix a bunch of warnings that are generated by gcc when compiling with -Wall -Wextra.

The hack in hudclient.cpp is unfortunate, but unavoidable. GLib insists on storing a pointer to a function in a void*, even though that has been illegal since C89. Even with a sledgehammer cast, gcc rightfully issues the warning about the illegal conversion. Unfortunately, the union is the only work-around I am aware of. On architectures where pointers to data and pointers to text have different sizes, this will not work (but almost certainly cause a segfault straight away).

Approved by Albert Astals Cid, PS Jenkins bot.

548. By Michael Zanetti on 2013-04-08

added a bzr hook to execute tests on comitting and pushing

to install:
cd .bazaar
make install.

Approved by PS Jenkins bot, Albert Astals Cid.

549. By Albert Astals Cid on 2013-04-08

IndicatorRow test needs the source dir here not the build dir
.

Approved by PS Jenkins bot, Nick Dedekind, Michał Sawicz.

550. By Brandon Schaefer on 2013-04-08

qmlRegisterType for CategoryFilter so we dont have to do unnecessary casting in category.cpp.

Approved by Albert Astals Cid, PS Jenkins bot.

551. By Michael Zanetti on 2013-04-08

generate more test statistics

* adjusts the coverage part of CMakeLists.txt to our other projects and makes it discoverable by our jenkins hooks
* enables test result file generation for plugins/Utils
* makes a randomly failing greeter test more robust
* renames coverage.xml for qml to avoid clashing with real lcov/gcov generated file.

Approved by PS Jenkins bot, Michał Sawicz.

552. By Michael Zanetti on 2013-04-08

dont stop test execution on a failure.

Approved by PS Jenkins bot, Michał Sawicz.

553. By Michael Zanetti on 2013-04-08

added tests for Tile.qml.

Approved by PS Jenkins bot, Andrea Cimitan.

554. By Daniel d'Andrada on 2013-04-09

Remove OnScreenKeyboard dead code

That's a mock that's no longer used.

Approved by PS Jenkins bot, Michał Sawicz.

555. By Andrea Cimitan on 2013-04-09

Moves tests into subfolders, reflecting the code hierarchy.
Some refactoring (following some guidelines from mzanetti) on the code of those tests.

Approved by Michael Zanetti, PS Jenkins bot.

Albert Astals Cid (aacid) wrote :

Doesn't merge properly with master

review: Needs Fixing
556. By Nick Dedekind on 2013-04-09

Added files/folders to bzrignore:
builddir
unity.qmlproject.user.

Approved by Andrea Cimitan, Albert Astals Cid, PS Jenkins bot.

557. By Andrea Cimitan on 2013-04-09

Add test for SearchIndicator under qmluitests/Panel.

Approved by PS Jenkins bot, Albert Astals Cid.

558. By Michael Zanetti on 2013-04-09

added missing copyright headers.

Approved by PS Jenkins bot, Albert Astals Cid.

559. By Daniel d'Andrada on 2013-04-09

Removed unused ApplicationLauncher plugin.

Approved by PS Jenkins bot, Albert Astals Cid.

560. By Nicolas d'Offay on 2013-04-09

tests for PageHeader and SearchHistoryModel.

Approved by PS Jenkins bot, Albert Astals Cid.

561. By Albert Astals Cid on 2013-04-09

Remove the unneeded QObject cast step

Also rename the setter to match the property name.

Approved by PS Jenkins bot, Michael Zanetti.

562. By Andrea Cimitan on 2013-04-09

Coding styles for tests.

Approved by PS Jenkins bot, Daniel d'Andrada.

563. By Andrea Cimitan on 2013-04-09

Add tests for ResponsiveFlowView.

Approved by PS Jenkins bot, Albert Astals Cid.

564. By Michael Zanetti on 2013-04-09

use a static python install path for autopilot tests. Fixes: https://bugs.launchpad.net/bugs/1164825.

Approved by Michał Sawicz, PS Jenkins bot.

565. By Michi Henning on 2013-04-10

Unity API first stage merge

This is stage one of the merge of the unity-api (skeleton) source tree into the phablet tree. This adds the source and header files from the unity-api tree into the correct spots, and updates the cmake files in minor ways to accommodate that.

There are also a bunch of changes to make the existing C++ code compile without warnings with -Wextra and -Wall.

There are remaining warnings that come from the Unity-6.0 build, caused by include/unity/UnityCore/ResultIterator.h.

I've submitted a separate merge request to fix this-- see https://code.launchpad.net/~michihenning/unity/ResultIterator-1163705 and https://bugs.launchpad.net/unity/+bug/1163705.

Approved by PS Jenkins bot, Jussi Pakkanen, Michał Sawicz.

566. By Michi Henning on 2013-04-10

Added VERSION and SOVERSION properties to cmake rules so we get the library with an soname and a symbolic link when installing.

Approved by PS Jenkins bot, Michał Sawicz.

567. By Michi Henning on 2013-04-10

Added -fvisibility=hidden to compile flags, so we don't export symbols by default.

Added unity/config.h, which defines a UNITY_API macro that, if UNITY_DLL_EXPORTS is defined, exports a symbol.

Added -DUNITY_DLL_EXPORTS to compile flags for libunity-api.

Added UNITY_API macro to classes and functions that are part of the public API.

Renamed config.h.in in the source root to paths.h.in. (This file should eventually be removed or moved elsewhere,
as should main.cpp. There should be no source files in the build root.

Approved by PS Jenkins bot, Michał Sawicz.

568. By Michi Henning on 2013-04-10

Added unit tests for the newly-added C++ files.

Approved by PS Jenkins bot, Jussi Pakkanen.

569. By Michi Henning on 2013-04-10

Moved ResourcePtr into unity::util::internal namespace.
The remaining changes are a consequence of the move and just adjust namespaces and #includes as appropriate. Fixes: https://bugs.launchpad.net/bugs/1166674.

Approved by Michał Sawicz, PS Jenkins bot.

570. By Michał Sawicz on 2013-04-10

bump the safe lp:unity/phablet-mods revision.

Approved by PS Jenkins bot, Albert Astals Cid.

571. By Michael Zanetti on 2013-04-10

Added a test for SideStage.
.

Approved by PS Jenkins bot, Andrea Cimitan.

572. By Nick Dedekind on 2013-04-10

Added tests for indicators.

Approved by PS Jenkins bot, Albert Astals Cid.

573. By Albert Astals Cid on 2013-04-10

Remove unneeded moc includes

We only need a #include "foo.moc" if defines a Q_OBJECT class in the .cpp file itself like qsortfilterproxymodeltest.cpp does
.

Approved by PS Jenkins bot, Michael Zanetti.

574. By Michi Henning on 2013-04-10

With the move of ResourcePtr to the internal namespace, I forgot to move the test for it into the corresponding directory. This MR fixes that.

Approved by PS Jenkins bot, Jussi Pakkanen.

575. By Michi Henning on 2013-04-11

Added test to scan for trailing whitespace in source files.

Approved by PS Jenkins bot, Jussi Pakkanen.

576. By Michał Sawicz on 2013-04-11

make sure qml coverage only runs qml tests, take .js into account and add a proper "alltests" target.

Approved by PS Jenkins bot, Michael Zanetti.

577. By Michał Sawicz on 2013-04-11

print up to 10 line numbers in check_whitespace.py and improve args handling.

Approved by PS Jenkins bot.

578. By Michael Zanetti on 2013-04-11

added tests for PeoplePreview.

Approved by Albert Astals Cid, PS Jenkins bot.

579. By Jussi Pakkanen on 2013-04-11

Detect unwanted implementation detail leakage in public headers

Our API design guidelines say that public headers should not leak implementation details such as gobject. This script checks that they don't.

Approved by PS Jenkins bot, Michi Henning.

580. By Michał Sawicz on 2013-04-11

use the ./build and ./run scripts on the device.

Approved by PS Jenkins bot, Albert Astals Cid.

581. By Michael Zanetti on 2013-04-11

get rid of old header which was replaced by switching to DashPreview.

Approved by PS Jenkins bot, Michał Sawicz.

Michał Sawicz (saviq) wrote :

You have a trailing whitespace on line 60 of tst_OpenEffect.qml

review: Needs Fixing
582. By Michał Sawicz on 2013-04-11

add missing phablet3 dependency, release 1.71.

Approved by PS Jenkins bot, Sergio Schvezov.

583. By Michael Zanetti on 2013-04-11

Bring back launcher tests.

Approved by PS Jenkins bot, Daniel d'Andrada.

584. By Michael Terry on 2013-04-12

Greeter: Make highlight box darker and rounder.

Approved by Katie Taylor, PS Jenkins bot, John Lea.

585. By Jussi Pakkanen on 2013-04-12

Check for indentation made with tabs.

Approved by PS Jenkins bot.

586. By Albert Astals Cid on 2013-04-12

No need to store the role names ourselves, just relay the source model roles.

Approved by Michał Sawicz, PS Jenkins bot, Michael Zanetti.

587. By Ying-Chun Liu on 2013-04-11

Add unittests for Components/OpenEffect.qml

588. By Ying-Chun Liu on 2013-04-12

Remove the trailing whitespaces.

Michael Zanetti (mzanetti) wrote :

lets get this in

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
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 add_qml_test(Carousel)
6 add_qml_test(CrossFadeImage)
7 add_qml_test(MathLocal)
8+add_qml_test(OpenEffect)
9 add_qml_test(RatingStars)
10 add_qml_test(TimeLocal)
11
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+/*
17+ * Copyright 2013 Canonical Ltd.
18+ *
19+ * This program is free software; you can redistribute it and/or modify
20+ * it under the terms of the GNU General Public License as published by
21+ * the Free Software Foundation; version 3.
22+ *
23+ * This program is distributed in the hope that it will be useful,
24+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
25+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26+ * GNU General Public License for more details.
27+ *
28+ * You should have received a copy of the GNU General Public License
29+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
30+ */
31+
32+import QtQuick 2.0
33+import QtTest 1.0
34+import "../../../Components"
35+
36+TestCase {
37+ name: "OpenEffectTest"
38+
39+ function test_openeffect_enabled() {
40+ compare(openEffect1.enabled, true, "OpenEffect should be enabled if gap is greather than 0.0")
41+ }
42+
43+ function test_openeffect_shadereffectsource() {
44+ compare(openEffect1.source.hideSource, true, "OpenEffect ShaderEffectSource is incorrect")
45+ compare(openEffect1.source.sourceItem, rectangle2, "OpenEffect ShaderEffectSource is incorrect")
46+ compare(openEffect1.source.live, true, "OpenEffect ShaderEffectSource is incorrect")
47+ compare(openEffect1.source.sourceRect.x, 0, "OpenEffect ShaderEffectSource is incorrect")
48+ compare(openEffect1.source.sourceRect.y, 0, "OpenEffect ShaderEffectSource is incorrect")
49+ compare(openEffect1.source.sourceRect.width, 50, "OpenEffect ShaderEffectSource is incorrect")
50+ compare(openEffect1.source.sourceRect.height, 71, "OpenEffect ShaderEffectSource is incorrect")
51+ openEffect1.gap=2.0
52+ compare(openEffect1.source.sourceRect.x, 0, "OpenEffect ShaderEffectSource is incorrect")
53+ compare(openEffect1.source.sourceRect.y, 0, "OpenEffect ShaderEffectSource is incorrect")
54+ compare(openEffect1.source.sourceRect.width, 50, "OpenEffect ShaderEffectSource is incorrect")
55+ compare(openEffect1.source.sourceRect.height, 72, "OpenEffect ShaderEffectSource is incorrect")
56+ }
57+
58+ Rectangle {
59+ id: rectangle1
60+
61+ width: 100; height: 100
62+
63+ Rectangle {
64+ id: rectangle2
65+ width: 50; height: 50
66+ }
67+
68+ OpenEffect {
69+ id: openEffect1
70+ anchors {
71+ fill: parent
72+ }
73+
74+ property real gap: 1.0
75+
76+ topGapPx: (1 - gap) * positionPx
77+ topOpacity: (1 - gap * 1.2)
78+ bottomGapPx: positionPx + gap * 10
79+ bottomOverflow: 20 + gap
80+ bottomOpacity: 1 - (gap * 0.8)
81+
82+ positionPx: gap
83+ sourceItem: rectangle2
84+ }
85+ }
86+}

Subscribers

People subscribed via source and target branches