aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2014-12-09 12:26:59 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-12-12 06:13:47 +0100
commit88508e9f4081a9b0008793dbe90c65f6b96c0f0f (patch)
tree9813ac08b1474051451f0926cc90d88594d20657 /tests
parentfdd367efd705f958af1f70413e726d337e8ec1ca (diff)
Remove QML bundle code
This feature is effectively not maintained, experimental and undocumented. Consensus on the mailing list is to remove it: http://lists.qt-project.org/pipermail/development/2014-December/019384.html Change-Id: Iaa73b3e90806c338ef81bbd4307ddd2addd37964 Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qml.pro1
-rw-r--r--tests/auto/qml/qqmlbundle/data/bundleImport/bundleImport.1.qml4
-rw-r--r--tests/auto/qml/qqmlbundle/data/bundleImport/bundleImport.2.qml4
-rw-r--r--tests/auto/qml/qqmlbundle/data/bundleImport/bundledata/MyType.qml6
-rw-r--r--tests/auto/qml/qqmlbundle/data/bundleImport/bundledata/subdir/MySubType.qml7
-rw-r--r--tests/auto/qml/qqmlbundle/data/componentFromBundle/bundledata/test.qml6
-rw-r--r--tests/auto/qml/qqmlbundle/data/import.qml4
-rw-r--r--tests/auto/qml/qqmlbundle/data/imports/bundletest/bundledata/qmldir2
-rw-r--r--tests/auto/qml/qqmlbundle/data/imports/bundletest/bundledata/subdir/qmldir1
-rw-r--r--tests/auto/qml/qqmlbundle/data/imports/bundletest/plugin.cpp73
-rw-r--r--tests/auto/qml/qqmlbundle/data/imports/bundletest/plugin1.pro7
-rw-r--r--tests/auto/qml/qqmlbundle/data/relativeQmldir/bundledata/subdir/qmldir1
-rw-r--r--tests/auto/qml/qqmlbundle/data/relativeQmldir/bundledata/subdir/st.qml6
-rw-r--r--tests/auto/qml/qqmlbundle/data/relativeQmldir/bundledata/test.qml4
-rw-r--r--tests/auto/qml/qqmlbundle/data/relativeResolution.1/bundledata/MyType.qml6
-rw-r--r--tests/auto/qml/qqmlbundle/data/relativeResolution.1/bundledata/test.qml4
-rw-r--r--tests/auto/qml/qqmlbundle/data/relativeResolution.2/bundledata/subdir/MyType.qml6
-rw-r--r--tests/auto/qml/qqmlbundle/data/relativeResolution.2/bundledata/subdir/test.qml4
-rw-r--r--tests/auto/qml/qqmlbundle/qqmlbundle.pro2
-rw-r--r--tests/auto/qml/qqmlbundle/tst_qqmlbundle.cpp252
-rw-r--r--tests/auto/qml/qqmlbundle/tst_qqmlbundle.pro16
21 files changed, 0 insertions, 416 deletions
diff --git a/tests/auto/qml/qml.pro b/tests/auto/qml/qml.pro
index ea15b5f495..3449050fe8 100644
--- a/tests/auto/qml/qml.pro
+++ b/tests/auto/qml/qml.pro
@@ -51,7 +51,6 @@ PRIVATETESTS += \
qqmltypeloader \
qqmlparser \
qquickworkerscript \
- qqmlbundle \
qrcqml \
qqmltimer \
qqmlinstantiator \
diff --git a/tests/auto/qml/qqmlbundle/data/bundleImport/bundleImport.1.qml b/tests/auto/qml/qqmlbundle/data/bundleImport/bundleImport.1.qml
deleted file mode 100644
index b87ba9c808..0000000000
--- a/tests/auto/qml/qqmlbundle/data/bundleImport/bundleImport.1.qml
+++ /dev/null
@@ -1,4 +0,0 @@
-import "bundle://mybundle"
-
-MyType {
-}
diff --git a/tests/auto/qml/qqmlbundle/data/bundleImport/bundleImport.2.qml b/tests/auto/qml/qqmlbundle/data/bundleImport/bundleImport.2.qml
deleted file mode 100644
index 0c0622e95d..0000000000
--- a/tests/auto/qml/qqmlbundle/data/bundleImport/bundleImport.2.qml
+++ /dev/null
@@ -1,4 +0,0 @@
-import "bundle://mybundle/subdir"
-
-MySubType {
-}
diff --git a/tests/auto/qml/qqmlbundle/data/bundleImport/bundledata/MyType.qml b/tests/auto/qml/qqmlbundle/data/bundleImport/bundledata/MyType.qml
deleted file mode 100644
index c473560849..0000000000
--- a/tests/auto/qml/qqmlbundle/data/bundleImport/bundledata/MyType.qml
+++ /dev/null
@@ -1,6 +0,0 @@
-import QtQuick 2.0
-
-QtObject {
- property real test1: 1918
- property string test2: "Hello world!"
-}
diff --git a/tests/auto/qml/qqmlbundle/data/bundleImport/bundledata/subdir/MySubType.qml b/tests/auto/qml/qqmlbundle/data/bundleImport/bundledata/subdir/MySubType.qml
deleted file mode 100644
index ce136f213b..0000000000
--- a/tests/auto/qml/qqmlbundle/data/bundleImport/bundledata/subdir/MySubType.qml
+++ /dev/null
@@ -1,7 +0,0 @@
-import QtQuick 2.0
-
-QtObject {
- property real test1: 1432
- property string test2: "Jeronimo"
-}
-
diff --git a/tests/auto/qml/qqmlbundle/data/componentFromBundle/bundledata/test.qml b/tests/auto/qml/qqmlbundle/data/componentFromBundle/bundledata/test.qml
deleted file mode 100644
index ce81efe86b..0000000000
--- a/tests/auto/qml/qqmlbundle/data/componentFromBundle/bundledata/test.qml
+++ /dev/null
@@ -1,6 +0,0 @@
-import QtQuick 2.0
-
-QtObject {
- property int test1: 11
- property bool test2: true
-}
diff --git a/tests/auto/qml/qqmlbundle/data/import.qml b/tests/auto/qml/qqmlbundle/data/import.qml
deleted file mode 100644
index af527199a7..0000000000
--- a/tests/auto/qml/qqmlbundle/data/import.qml
+++ /dev/null
@@ -1,4 +0,0 @@
-import bundletest 2.0
-
-MyPluginType {
-}
diff --git a/tests/auto/qml/qqmlbundle/data/imports/bundletest/bundledata/qmldir b/tests/auto/qml/qqmlbundle/data/imports/bundletest/bundledata/qmldir
deleted file mode 100644
index febddf6a47..0000000000
--- a/tests/auto/qml/qqmlbundle/data/imports/bundletest/bundledata/qmldir
+++ /dev/null
@@ -1,2 +0,0 @@
-module bundletest
-plugin plugin1
diff --git a/tests/auto/qml/qqmlbundle/data/imports/bundletest/bundledata/subdir/qmldir b/tests/auto/qml/qqmlbundle/data/imports/bundletest/bundledata/subdir/qmldir
deleted file mode 100644
index 305d075dc7..0000000000
--- a/tests/auto/qml/qqmlbundle/data/imports/bundletest/bundledata/subdir/qmldir
+++ /dev/null
@@ -1 +0,0 @@
-plugin plugin2
diff --git a/tests/auto/qml/qqmlbundle/data/imports/bundletest/plugin.cpp b/tests/auto/qml/qqmlbundle/data/imports/bundletest/plugin.cpp
deleted file mode 100644
index 533ee8d4d0..0000000000
--- a/tests/auto/qml/qqmlbundle/data/imports/bundletest/plugin.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL21$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include <QStringList>
-#include <QtQml/qqmlextensionplugin.h>
-#include <QtQml/qqml.h>
-#include <QDebug>
-
-class MyPluginType : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(int value READ value WRITE setValue)
-
-public:
- MyPluginType(QObject *parent=0) : QObject(parent), v(32)
- {
- }
-
- int value() const { return v; }
- void setValue(int i) { v = i; }
-
-private:
- int v;
-};
-
-
-class MyPlugin : public QQmlExtensionPlugin
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
-
-public:
- MyPlugin()
- {
- }
-
- void registerTypes(const char *uri)
- {
- qmlRegisterType<MyPluginType>(uri, 2, 0, "MyPluginType");
- }
-};
-
-#include "plugin.moc"
-
diff --git a/tests/auto/qml/qqmlbundle/data/imports/bundletest/plugin1.pro b/tests/auto/qml/qqmlbundle/data/imports/bundletest/plugin1.pro
deleted file mode 100644
index 934bb2d591..0000000000
--- a/tests/auto/qml/qqmlbundle/data/imports/bundletest/plugin1.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TEMPLATE = lib
-CONFIG += plugin
-SOURCES += plugin.cpp
-QT = core qml
-
-DESTDIR = ./
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/qml/qqmlbundle/data/relativeQmldir/bundledata/subdir/qmldir b/tests/auto/qml/qqmlbundle/data/relativeQmldir/bundledata/subdir/qmldir
deleted file mode 100644
index 628edcbfa3..0000000000
--- a/tests/auto/qml/qqmlbundle/data/relativeQmldir/bundledata/subdir/qmldir
+++ /dev/null
@@ -1 +0,0 @@
-MySubdirType 1.0 st.qml
diff --git a/tests/auto/qml/qqmlbundle/data/relativeQmldir/bundledata/subdir/st.qml b/tests/auto/qml/qqmlbundle/data/relativeQmldir/bundledata/subdir/st.qml
deleted file mode 100644
index 496eda83d1..0000000000
--- a/tests/auto/qml/qqmlbundle/data/relativeQmldir/bundledata/subdir/st.qml
+++ /dev/null
@@ -1,6 +0,0 @@
-import QtQuick 2.0
-
-QtObject {
- property int test1: 67
- property real test2: 88
-}
diff --git a/tests/auto/qml/qqmlbundle/data/relativeQmldir/bundledata/test.qml b/tests/auto/qml/qqmlbundle/data/relativeQmldir/bundledata/test.qml
deleted file mode 100644
index 1046b8859f..0000000000
--- a/tests/auto/qml/qqmlbundle/data/relativeQmldir/bundledata/test.qml
+++ /dev/null
@@ -1,4 +0,0 @@
-import "subdir"
-
-MySubdirType {
-}
diff --git a/tests/auto/qml/qqmlbundle/data/relativeResolution.1/bundledata/MyType.qml b/tests/auto/qml/qqmlbundle/data/relativeResolution.1/bundledata/MyType.qml
deleted file mode 100644
index ce81efe86b..0000000000
--- a/tests/auto/qml/qqmlbundle/data/relativeResolution.1/bundledata/MyType.qml
+++ /dev/null
@@ -1,6 +0,0 @@
-import QtQuick 2.0
-
-QtObject {
- property int test1: 11
- property bool test2: true
-}
diff --git a/tests/auto/qml/qqmlbundle/data/relativeResolution.1/bundledata/test.qml b/tests/auto/qml/qqmlbundle/data/relativeResolution.1/bundledata/test.qml
deleted file mode 100644
index 2e753d2dbc..0000000000
--- a/tests/auto/qml/qqmlbundle/data/relativeResolution.1/bundledata/test.qml
+++ /dev/null
@@ -1,4 +0,0 @@
-import QtQuick 2.0
-
-MyType {
-}
diff --git a/tests/auto/qml/qqmlbundle/data/relativeResolution.2/bundledata/subdir/MyType.qml b/tests/auto/qml/qqmlbundle/data/relativeResolution.2/bundledata/subdir/MyType.qml
deleted file mode 100644
index ce81efe86b..0000000000
--- a/tests/auto/qml/qqmlbundle/data/relativeResolution.2/bundledata/subdir/MyType.qml
+++ /dev/null
@@ -1,6 +0,0 @@
-import QtQuick 2.0
-
-QtObject {
- property int test1: 11
- property bool test2: true
-}
diff --git a/tests/auto/qml/qqmlbundle/data/relativeResolution.2/bundledata/subdir/test.qml b/tests/auto/qml/qqmlbundle/data/relativeResolution.2/bundledata/subdir/test.qml
deleted file mode 100644
index 2e753d2dbc..0000000000
--- a/tests/auto/qml/qqmlbundle/data/relativeResolution.2/bundledata/subdir/test.qml
+++ /dev/null
@@ -1,4 +0,0 @@
-import QtQuick 2.0
-
-MyType {
-}
diff --git a/tests/auto/qml/qqmlbundle/qqmlbundle.pro b/tests/auto/qml/qqmlbundle/qqmlbundle.pro
deleted file mode 100644
index ec81e3f234..0000000000
--- a/tests/auto/qml/qqmlbundle/qqmlbundle.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += tst_qqmlbundle.pro data/imports/bundletest/plugin1.pro
diff --git a/tests/auto/qml/qqmlbundle/tst_qqmlbundle.cpp b/tests/auto/qml/qqmlbundle/tst_qqmlbundle.cpp
deleted file mode 100644
index 308ba415f6..0000000000
--- a/tests/auto/qml/qqmlbundle/tst_qqmlbundle.cpp
+++ /dev/null
@@ -1,252 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL21$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// Lookup of libraries
-// Test bundle as a qmldir
-
-#include <qtest.h>
-#include <QDebug>
-#include <QQmlEngine>
-#include <QQmlComponent>
-#include "../../shared/util.h"
-#include <private/qqmlbundle_p.h>
-
-class tst_qqmlbundle : public QQmlDataTest
-{
- Q_OBJECT
-public:
- tst_qqmlbundle() {}
-
-private slots:
- void initTestCase();
-
- void componentFromBundle();
- void relativeResolution();
- void bundleImport();
- void relativeQmldir();
-
- void import();
-
-private:
- QStringList findFiles(const QDir &d);
- bool makeBundle(const QString &path, const QString &name);
-};
-
-void tst_qqmlbundle::initTestCase()
-{
- QQmlDataTest::initTestCase();
-}
-
-// Test we create a QQmlComponent for a file inside a bundle
-void tst_qqmlbundle::componentFromBundle()
-{
- QVERIFY(makeBundle(testFile("componentFromBundle"), "my.bundle"));
-
- QQmlEngine engine;
- engine.addNamedBundle("mybundle", testFile("componentFromBundle/my.bundle"));
-
- QQmlComponent component(&engine, QUrl("bundle://mybundle/test.qml"));
- QVERIFY(component.isReady());
-
- QObject *o = component.create();
- QVERIFY(o != 0);
-
- QCOMPARE(o->property("test1").toInt(), 11);
- QCOMPARE(o->property("test2").toBool(), true);
-
- delete o;
-}
-
-// Tests that relative QML components are resolved without a qmldir
-void tst_qqmlbundle::relativeResolution()
-{
- // Root of the bundle
- {
- QVERIFY(makeBundle(testFile("relativeResolution.1"), "my.bundle"));
-
- QQmlEngine engine;
- engine.addNamedBundle("mybundle", testFile("relativeResolution.1/my.bundle"));
-
- QQmlComponent component(&engine, QUrl("bundle://mybundle/test.qml"));
- QVERIFY(component.isReady());
-
- QObject *o = component.create();
- QVERIFY(o != 0);
-
- QCOMPARE(o->property("test1").toInt(), 11);
- QCOMPARE(o->property("test2").toBool(), true);
-
- delete o;
- }
-
- // Non-root of the bundle
- {
- QVERIFY(makeBundle(testFile("relativeResolution.2"), "my.bundle"));
-
- QQmlEngine engine;
- engine.addNamedBundle("mybundle", testFile("relativeResolution.2/my.bundle"));
-
- QQmlComponent component(&engine, QUrl("bundle://mybundle/subdir/test.qml"));
- QVERIFY(component.isReady());
-
- QObject *o = component.create();
- QVERIFY(o != 0);
-
- QCOMPARE(o->property("test1").toInt(), 11);
- QCOMPARE(o->property("test2").toBool(), true);
-
- delete o;
- }
-}
-
-// Test that a bundle can be imported explicitly from outside a bundle
-void tst_qqmlbundle::bundleImport()
-{
- QVERIFY(makeBundle(testFile("bundleImport"), "my.bundle"));
-
- QQmlEngine engine;
- engine.addNamedBundle("mybundle", testFile("bundleImport/my.bundle"));
-
- {
- QQmlComponent component(&engine, testFileUrl("bundleImport/bundleImport.1.qml"));
- QVERIFY(component.isReady());
-
- QObject *o = component.create();
- QVERIFY(o != 0);
-
- QCOMPARE(o->property("test1").toReal(), qreal(1918));
- QCOMPARE(o->property("test2").toString(), QString("Hello world!"));
-
- delete o;
- }
-
- {
- QQmlComponent component(&engine, testFileUrl("bundleImport/bundleImport.2.qml"));
- QVERIFY(component.isReady());
-
- QObject *o = component.create();
- QVERIFY(o != 0);
-
- QCOMPARE(o->property("test1").toReal(), qreal(1432));
- QCOMPARE(o->property("test2").toString(), QString("Jeronimo"));
-
- delete o;
- }
-}
-
-// Test a relative import inside a bundle uses qmldir
-void tst_qqmlbundle::relativeQmldir()
-{
- QVERIFY(makeBundle(testFile("relativeQmldir"), "my.bundle"));
-
- QQmlEngine engine;
- engine.addNamedBundle("mybundle", testFile("relativeQmldir/my.bundle"));
-
- QQmlComponent component(&engine, QUrl("bundle://mybundle/test.qml"));
- QVERIFY(component.isReady());
-
- QObject *o = component.create();
- QVERIFY(o != 0);
-
- QCOMPARE(o->property("test1").toReal(), qreal(67));
- QCOMPARE(o->property("test2").toReal(), qreal(88));
-
- delete o;
-}
-
-// Test C++ plugins are resolved relative to the bundle container file
-void tst_qqmlbundle::import()
-{
- QVERIFY(makeBundle(testFile("imports/bundletest"), "qmldir"));
-
- QQmlEngine engine;
- engine.addImportPath(testFile("imports"));
-
- QQmlComponent component(&engine, testFileUrl("import.qml"));
- QVERIFY2(component.isReady(), QQmlDataTest::msgComponentError(component, &engine));
-
- QObject *o = component.create();
- QVERIFY(o != 0);
-
- QCOMPARE(o->property("value").toInt(), 32);
-
- delete o;
-}
-
-// Transform the data available under <path>/bundledata to a bundle named <path>/<name>
-bool tst_qqmlbundle::makeBundle(const QString &path, const QString &name)
-{
- QDir dir(path);
- dir.remove(name);
-
- QDir bundleDir = dir;
- if (!bundleDir.cd("bundledata"))
- return false;
-
- QStringList fileNames = findFiles(bundleDir);
-
- QString bundleFile = dir.absolutePath() + QDir::separator() + name;
-
- QQmlBundle bundle(bundleFile);
- if (!bundle.open(QFile::WriteOnly))
- return false;
-
- foreach (const QString &fileName, fileNames) {
- QString shortFileName = fileName.mid(bundleDir.absolutePath().length() + 1);
- bundle.add(shortFileName, fileName);
- }
-
- return true;
-}
-
-QStringList tst_qqmlbundle::findFiles(const QDir &d)
-{
- QStringList rv;
-
- QStringList files = d.entryList(QDir::Files);
- foreach (const QString &file, files)
- rv << d.absoluteFilePath(file);
-
- QStringList dirs = d.entryList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks);
- foreach (const QString &dir, dirs) {
- QDir sub = d;
- sub.cd(dir);
- rv << findFiles(sub);
- }
-
- return rv;
-}
-
-QTEST_MAIN(tst_qqmlbundle)
-
-#include "tst_qqmlbundle.moc"
diff --git a/tests/auto/qml/qqmlbundle/tst_qqmlbundle.pro b/tests/auto/qml/qqmlbundle/tst_qqmlbundle.pro
deleted file mode 100644
index 1a6d1e3a8f..0000000000
--- a/tests/auto/qml/qqmlbundle/tst_qqmlbundle.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-CONFIG += testcase
-TARGET = tst_qqmlbundle
-macx:CONFIG -= app_bundle
-
-SOURCES += tst_qqmlbundle.cpp
-HEADERS +=
-
-include (../../shared/util.pri)
-
-TESTDATA = data/*
-
-CONFIG += parallel_test
-
-QT += qml-private testlib gui-private
-
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0