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

Proposed by Cris Dywan
Status: Merged
Approved by: Cris Dywan
Approved revision: 1045
Merged at revision: 1089
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/engineLauncher
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 183 lines (+157/-0)
4 files modified
debian/ubuntu-ui-toolkit-autopilot.install (+1/-0)
tests/launcher/launcher.cpp (+143/-0)
tests/launcher/launcher.pro (+11/-0)
tests/tests.pro (+2/-0)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/engineLauncher
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Leo Arias (community) tried with my unity test Approve
Tim Peeters Approve
Review via email: mp+218772@code.launchpad.net

Commit message

Add a launcher with a switch for the QQMLEngine

Description of the change

This launcher has an -engine switch that affects the internal component tree, as can be seen in 'autopilot vis' and affects running test cases in autopilot.

See lp:~elopio/ubuntu-ui-toolkit/improve_unity_container launch_application/ get_alternate_launch_command

To post a comment you must log in.
Revision history for this message
Tim Peeters (tpeeters) wrote :

110 + QString filename(args.at(1));
111 + args.removeAt(0);

should that be removeAt(1)?

Revision history for this message
Tim Peeters (tpeeters) wrote :

good, thanks.

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

PASSED: Continuous integration, rev:1041
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/227/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/206
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/189
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/59
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/59
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/59/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/59
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/699
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/436
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/436/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/7147
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/173
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/235
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/235/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/227/rebuild

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

PASSED: Continuous integration, rev:1043
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/228/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/209
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/191
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/60
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/60
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/60/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/60
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/702
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/439
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/439/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/7151
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/175
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/237
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/237/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/228/rebuild

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

PASSED: Continuous integration, rev:1044
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/244/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/312
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/277
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/76
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/76
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/76/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/76
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/795
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/614
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/614/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/7319
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/250
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/348
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/348/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/244/rebuild

review: Approve (continuous-integration)
Revision history for this message
Leo Arias (elopio) :
review: Approve (tried with my unity test)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-autolanding/137/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/539
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/486
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-autolanding/81
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-autolanding/81
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-autolanding/81/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-autolanding/81
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/988
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1041
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1041/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/7852
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/430
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/624
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/624/artifact/work/output/*zip*/output.zip

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

PASSED: Continuous integration, rev:1045
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/302/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/545
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/494
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/134
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/134
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/134/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/134
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/991
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1052
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1052/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/7861
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/437
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/632
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/632/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/302/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/ubuntu-ui-toolkit-autopilot.install'
2--- debian/ubuntu-ui-toolkit-autopilot.install 2014-02-21 23:39:43 +0000
3+++ debian/ubuntu-ui-toolkit-autopilot.install 2014-05-28 13:36:57 +0000
4@@ -1,2 +1,3 @@
5 usr/lib/python3
6+usr/lib/ubuntu-ui-toolkit/launcher
7 usr/lib/python2.7
8
9=== added directory 'tests/launcher'
10=== added file 'tests/launcher/launcher.cpp'
11--- tests/launcher/launcher.cpp 1970-01-01 00:00:00 +0000
12+++ tests/launcher/launcher.cpp 2014-05-28 13:36:57 +0000
13@@ -0,0 +1,143 @@
14+/*
15+ * Copyright 2014 Canonical Ltd.
16+ *
17+ * This program is free software; you can redistribute it and/or modify
18+ * it under the terms of the GNU Lesser General Public License as published by
19+ * the Free Software Foundation; version 3.
20+ *
21+ * This program is distributed in the hope that it will be useful,
22+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
23+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24+ * GNU Lesser General Public License for more details.
25+ *
26+ * You should have received a copy of the GNU Lesser General Public License
27+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
28+ *
29+ * QML launcher with the ability to setup the QQuickView/ QQmlEngine differently
30+ *
31+ * Rationale: Different variants of qmlscene exist as well as C++ and Go apps
32+ * This is to write Autopilot test cases that exhibit specific behavior
33+ */
34+
35+#include <iostream>
36+#include <QtCore/qdebug.h>
37+#include <QtQuick/QQuickView>
38+#include <QtGui/QGuiApplication>
39+#include <QtQml/QQmlEngine>
40+#include <QtQml/QQmlContext>
41+#include <QtCore/QFileInfo>
42+#include <QLibrary>
43+#include <QOpenGLContext>
44+#include <QtGui/private/qopenglcontext_p.h>
45+#include <QtQuick/private/qsgcontext_p.h>
46+
47+int usage()
48+{
49+ QString self(QGuiApplication::instance()->arguments().at(0));
50+ std::cout << "Usage\n "
51+ << qPrintable(self)
52+ << " -testability -frameless -engine"
53+ << " --desktop_file_path=DESKTOP_FILE"
54+ << " -I MODULE_PATH FILENAME\n";
55+ return 1;
56+}
57+
58+int main(int argc, const char *argv[])
59+{
60+ // QPlatformIntegration::ThreadedOpenGL
61+ setenv("QML_FORCE_THREADED_RENDERER", "1", 1);
62+ // QPlatformIntegration::BufferQueueingOpenGL
63+ setenv("QML_FIXED_ANIMATION_STEP", "1", 1);
64+ // Oxide and QWebEngine need a shared context
65+ QScopedPointer<QOpenGLContext> shareContext;
66+ shareContext.reset(new QOpenGLContext);
67+ QSGContext::setSharedOpenGLContext(shareContext.data());
68+
69+ QGuiApplication::setApplicationName("UITK Launcher");
70+ QGuiApplication application(argc, (char**)argv);
71+ QStringList args (application.arguments());
72+
73+ int _testability(args.indexOf("-testability"));
74+ args.removeAt(_testability);
75+ int _frameless(args.indexOf("-frameless"));
76+ args.removeAt(_frameless);
77+ int _engine(args.indexOf("-engine"));
78+ args.removeAt(_engine);
79+
80+ Q_FOREACH(QString arg, args) {
81+ if (arg.startsWith("--desktop_file_hint")) {
82+ // This will not be used - it only needs to be ignored
83+ int _desktop_file_hint(args.indexOf(arg));
84+ args.removeAt(_desktop_file_hint);
85+ }
86+ }
87+
88+ // Testability is only supported out of the box by QApplication not QGuiApplication
89+ if (_testability > -1 || getenv("QT_LOAD_TESTABILITY")) {
90+ QLibrary testLib(QLatin1String("qttestability"));
91+ if (testLib.load()) {
92+ typedef void (*TasInitialize)(void);
93+ TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init");
94+ if (initFunction) {
95+ initFunction();
96+ } else {
97+ qCritical("Library qttestability resolve failed!");
98+ return 1;
99+ }
100+ } else {
101+ qCritical("Library qttestability load failed!");
102+ return 1;
103+ }
104+ }
105+
106+ QQmlEngine* engine;
107+ // The default constructor affects the components tree (autopilot vis)
108+ QQuickView* view;
109+ if (_engine > -1) {
110+ view = new QQuickView();
111+ engine = view->engine();
112+ } else {
113+ engine = new QQmlEngine();
114+ view = new QQuickView(engine, NULL);
115+ }
116+
117+ int _import(args.indexOf("-I"));
118+ args.removeAt(_import);
119+ if (_import > -1) {
120+ if (args.count() > _import) {
121+ QString importPath(args.at(_import));
122+ args.removeAt(_import);
123+ engine->addImportPath(importPath);
124+ }
125+ }
126+
127+ view->setResizeMode(QQuickView::SizeRootObjectToView);
128+ view->setTitle("UI Toolkit QQuickView");
129+ if (_frameless > -1) {
130+ view->setFlags(Qt::FramelessWindowHint);
131+ }
132+
133+ // The remaining unnamed argument must be a filename
134+ if (args.count() == 1) {
135+ qCritical() << "Missing filename";
136+ return usage();
137+ }
138+ QString filename(args.at(1));
139+ // The first argument is the launcher itself
140+ args.removeAt(0);
141+
142+ QUrl source(QUrl::fromLocalFile(filename));
143+ view->setSource(source);
144+ if (view->errors().count() > 0) {
145+ return usage();
146+ }
147+ view->show();
148+
149+ if (args.count() > 1) {
150+ qCritical() << "Invalid arguments passed" << args;
151+ return usage();
152+ }
153+
154+ return application.exec();
155+}
156+
157
158=== added file 'tests/launcher/launcher.pro'
159--- tests/launcher/launcher.pro 1970-01-01 00:00:00 +0000
160+++ tests/launcher/launcher.pro 2014-05-28 13:36:57 +0000
161@@ -0,0 +1,11 @@
162+TEMPLATE = app
163+QT += qml quick
164+# For setSharedOpenGLContext
165+QT += core-private gui-private quick-private
166+CONFIG += no_keywords
167+SOURCES += \
168+ launcher.cpp
169+launcher.path = /usr/lib/ubuntu-ui-toolkit
170+launcher.files = launcher
171+INSTALLS += launcher
172+
173
174=== modified file 'tests/tests.pro'
175--- tests/tests.pro 2014-02-21 23:39:43 +0000
176+++ tests/tests.pro 2014-05-28 13:36:57 +0000
177@@ -7,4 +7,6 @@
178 autopilot2_module.path = /usr/lib/python2.7/dist-packages/ubuntuuitoolkit
179 autopilot2_module.files = autopilot/ubuntuuitoolkit/*
180
181+SUBDIRS += launcher
182+
183 INSTALLS += autopilot_module autopilot2_module

Subscribers

People subscribed via source and target branches