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

Subscribers

People subscribed via source and target branches