Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/unitTestApiCheck into lp:ubuntu-ui-toolkit/staging

Proposed by Cris Dywan
Status: Merged
Approved by: Zsombor Egri
Approved revision: 1521
Merged at revision: 1558
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/unitTestApiCheck
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 190 lines (+149/-0)
7 files modified
tests/apicheck/apicheck.pro (+2/-0)
tests/apicheck/test/Extinct/Animals/digger.js (+22/-0)
tests/apicheck/test/Extinct/Animals/qmldir (+4/-0)
tests/apicheck/test/Extinct/Animals/test.qml (+72/-0)
tests/apicheck/test/components.api (+13/-0)
tests/apicheck/test/qmldir (+3/-0)
tests/apicheck/test/test.sh (+33/-0)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/unitTestApiCheck
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Zsombor Egri Approve
Review via email: mp+260348@code.launchpad.net

Commit message

Add apicheck unit test for QML and Javascript

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1521. By Cris Dywan

Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/staging

Revision history for this message
Zsombor Egri (zsombi) wrote :

Nice one, thx!!!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/apicheck/apicheck.pro'
2--- tests/apicheck/apicheck.pro 2015-05-11 12:46:48 +0000
3+++ tests/apicheck/apicheck.pro 2015-07-13 13:08:44 +0000
4@@ -9,4 +9,6 @@
5 apicheck.files = apicheck
6 INSTALLS += apicheck
7
8+check.commands += test/test.sh || exit 1;
9+
10 check.commands += ../qmlapicheck.sh || exit 1;
11
12=== added directory 'tests/apicheck/test'
13=== added directory 'tests/apicheck/test/Extinct'
14=== added directory 'tests/apicheck/test/Extinct/Animals'
15=== added file 'tests/apicheck/test/Extinct/Animals/digger.js'
16--- tests/apicheck/test/Extinct/Animals/digger.js 1970-01-01 00:00:00 +0000
17+++ tests/apicheck/test/Extinct/Animals/digger.js 2015-07-13 13:08:44 +0000
18@@ -0,0 +1,22 @@
19+/*
20+ * Copyright 2015 Canonical Ltd.
21+ *
22+ * This program is free software; you can redistribute it and/or modify
23+ * it under the terms of the GNU Lesser General Public License as published by
24+ * the Free Software Foundation; version 3.
25+ *
26+ * This program is distributed in the hope that it will be useful,
27+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
28+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29+ * GNU Lesser General Public License for more details.
30+ *
31+ * You should have received a copy of the GNU Lesser General Public License
32+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
33+ */
34+
35+/*!
36+ Return true if the object is a Flickable that can be flicked in vertical direction.
37+ */
38+
39+function makeHole(){
40+}
41
42=== added file 'tests/apicheck/test/Extinct/Animals/qmldir'
43--- tests/apicheck/test/Extinct/Animals/qmldir 1970-01-01 00:00:00 +0000
44+++ tests/apicheck/test/Extinct/Animals/qmldir 2015-07-13 13:08:44 +0000
45@@ -0,0 +1,4 @@
46+module Extinct.Animals
47+Titanoboa 4.2 test.qml
48+internal WoollyMammoth mammoth.qml
49+Excavator 1.0 digger.js
50
51=== added file 'tests/apicheck/test/Extinct/Animals/test.qml'
52--- tests/apicheck/test/Extinct/Animals/test.qml 1970-01-01 00:00:00 +0000
53+++ tests/apicheck/test/Extinct/Animals/test.qml 2015-07-13 13:08:44 +0000
54@@ -0,0 +1,72 @@
55+/*
56+ * Copyright (C) 2015 Canonical, Ltd.
57+ *
58+ * This program is free software; you can redistribute it and/or modify
59+ * it under the terms of the GNU General Public License as published by
60+ * the Free Software Foundation; version 3.
61+ *
62+ * This program is distributed in the hope that it will be useful,
63+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
64+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
65+ * GNU General Public License for more details.
66+ *
67+ * You should have received a copy of the GNU General Public License
68+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
69+ */
70+
71+import QtQuick 2.0
72+
73+Item {
74+ id: foo
75+ property string spam
76+ /*!
77+ \qmlproperty string eggs
78+ */
79+ property string eggs: "white"
80+ /*!
81+ \qmlproperty string bar
82+ \since Extinct.Animals 1.1
83+ */
84+ property alias bar: foo.eggs
85+ /*!
86+ \internal
87+ */
88+ property var basket: ['brown', 'white']
89+
90+ states: [
91+ State {
92+ name: ""
93+ }
94+ ]
95+
96+ signal jump()
97+ /*!
98+ \since 2.2
99+ */
100+ signal bounce(int length)
101+ /*!
102+ \qmlproperty url bazz
103+ */
104+ property url bazz:"http://example.com"
105+ /*!
106+ \qmlmethod void fly(Wing wing)
107+ */
108+ signal fly(var wing)
109+
110+ function first() {
111+ console.log('Haha!')
112+ }
113+ /*!
114+ \since 3.3
115+ */
116+ function second(sliff) {
117+ }
118+ function third(sloff) { }
119+
120+ Item {
121+ id: one
122+ function two() {
123+ }
124+ function three() { }
125+ }
126+}
127
128=== added file 'tests/apicheck/test/components.api'
129--- tests/apicheck/test/components.api 1970-01-01 00:00:00 +0000
130+++ tests/apicheck/test/components.api 2015-07-13 13:08:44 +0000
131@@ -0,0 +1,13 @@
132+Extinct.Animals.Excavator 1.0
133+Extinct.Animals.Titanoboa 4.2: Item
134+ property string bar
135+ property var basket
136+ property url bazz
137+ property string eggs
138+ signal jump()
139+ signal bounce(int length)
140+ signal fly(var wing)
141+ function var first()
142+ function var second(var sliff)
143+ function var third(var sloff)
144+ property string spam
145
146=== added file 'tests/apicheck/test/qmldir'
147--- tests/apicheck/test/qmldir 1970-01-01 00:00:00 +0000
148+++ tests/apicheck/test/qmldir 2015-07-13 13:08:44 +0000
149@@ -0,0 +1,3 @@
150+module Extinct.Animals
151+Titanoboa 4.2 test.qml
152+internal WoollyMammoth mammoth.qml
153
154=== added file 'tests/apicheck/test/test.sh'
155--- tests/apicheck/test/test.sh 1970-01-01 00:00:00 +0000
156+++ tests/apicheck/test/test.sh 2015-07-13 13:08:44 +0000
157@@ -0,0 +1,33 @@
158+#!/usr/bin/env sh
159+#
160+# Copyright 2015 Canonical Ltd.
161+#
162+# This program is free software; you can redistribute it and/or modify
163+# it under the terms of the GNU Lesser General Public License as published by
164+# the Free Software Foundation; version 3.
165+#
166+# This program is distributed in the hope that it will be useful,
167+# but WITHOUT ANY WARRANTY; without even the implied warranty of
168+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
169+# GNU Lesser General Public License for more details.
170+#
171+# You should have received a copy of the GNU Lesser General Public License
172+# along with this program. If not, see <http://www.gnu.org/licenses/>.
173+#
174+################################################################################
175+
176+. `dirname $0`/../../../build_paths.inc
177+
178+if [ ! -e $BUILD_DIR/tests/apicheck/apicheck ]; then
179+ echo API check tool not built!
180+ exit 1
181+fi
182+
183+echo Self-testing API dump
184+# Silence spam on stderr due to fonts
185+# https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999
186+# https://bugreports.qt-project.org/browse/QTBUG-36243
187+env QML2_IMPORT_PATH=$SRC_DIR/tests/apicheck/test LANG=C \
188+ $BUILD_DIR/tests/apicheck/apicheck --qml Extinct.Animals | \
189+ diff -F '[.0-9]' -u $SRC_DIR/tests/apicheck/test/components.api -
190+test $? != 0 && echo Error: Mismatch || echo All fine.

Subscribers

People subscribed via source and target branches