aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml')
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/CompositeSingleton/qmldir2
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy.cpp39
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy.h44
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy.pro23
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy_plugin.cpp40
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy_plugin.h44
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Dummy/plugins.qmltypes17
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Dummy/qmldir3
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Imports/CompositeImports.qml5
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Imports/imports.cpp39
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Imports/imports.h44
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Imports/imports.pro24
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Imports/imports_plugin.cpp40
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Imports/imports_plugin.h44
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Imports/plugins.qmltypes17
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Imports/qmldir3
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Singleton/CompositeSingleton.qml6
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Singleton/qmldir2
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Versions/plugin.qmltypes23
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Versions/plugins.qmltypes23
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Versions/qmldir3
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Versions/versions.cpp39
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Versions/versions.h61
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Versions/versions.pro23
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Versions/versions_plugin.cpp41
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Versions/versions_plugin.h44
-rw-r--r--tests/auto/qml/qmlplugindump/qmlplugindump.pro14
-rw-r--r--tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp37
-rw-r--r--tests/auto/qml/qmlplugindump/tst_qmlplugindump.pro9
29 files changed, 742 insertions, 11 deletions
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/CompositeSingleton/qmldir b/tests/auto/qml/qmlplugindump/data/dumper/CompositeSingleton/qmldir
index 8df57f6d47..c08e74db2e 100644
--- a/tests/auto/qml/qmlplugindump/data/dumper/CompositeSingleton/qmldir
+++ b/tests/auto/qml/qmlplugindump/data/dumper/CompositeSingleton/qmldir
@@ -1,3 +1,3 @@
-module tests.dumper.CompositeSingleton
+module dumper.CompositeSingleton
singleton Singleton 1.0 Singleton.qml
depends QtQuick 2.0
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy.cpp b/tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy.cpp
new file mode 100644
index 0000000000..689ea4aa53
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy.cpp
@@ -0,0 +1,39 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "dummy.h"
+
+Dummy::Dummy(QObject *parent):
+ QObject(parent)
+{
+}
+
+Dummy::~Dummy()
+{
+}
+
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy.h b/tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy.h
new file mode 100644
index 0000000000..7011f72523
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy.h
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef DUMMY_H
+#define DUMMY_H
+
+#include <QObject>
+
+class Dummy : public QObject
+{
+ Q_OBJECT
+
+public:
+ Dummy(QObject *parent = nullptr);
+ ~Dummy();
+};
+
+#endif // DUMMY_H
+
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy.pro b/tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy.pro
new file mode 100644
index 0000000000..9f5bc927b4
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy.pro
@@ -0,0 +1,23 @@
+TEMPLATE = lib
+TARGET = Dummy
+QT += qml
+CONFIG += qt plugin
+
+CONFIG -= debug_and_release_target
+!build_pass:qtConfig(debug_and_release): CONFIG += release
+
+TARGET = $$qtLibraryTarget($$TARGET)
+
+SOURCES += \
+ dummy_plugin.cpp \
+ dummy.cpp
+
+HEADERS += \
+ dummy_plugin.h \
+ dummy.h
+
+!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
+ cp.files = qmldir plugins.qmltypes
+ cp.path = $$OUT_PWD
+ COPIES += cp
+}
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy_plugin.cpp b/tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy_plugin.cpp
new file mode 100644
index 0000000000..763604daf0
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy_plugin.cpp
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "dummy_plugin.h"
+#include "dummy.h"
+
+#include <qqml.h>
+
+void DummyPlugin::registerTypes(const char *uri)
+{
+ // @uri dumper.dummy
+ qmlRegisterType<Dummy>(uri, 1, 0, "Dummy");
+}
+
+
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy_plugin.h b/tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy_plugin.h
new file mode 100644
index 0000000000..86e80e6a08
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Dummy/dummy_plugin.h
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef DUMMY_PLUGIN_H
+#define DUMMY_PLUGIN_H
+
+#include <QQmlExtensionPlugin>
+
+class DummyPlugin : public QQmlExtensionPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
+
+public:
+ void registerTypes(const char *uri);
+};
+
+#endif // DUMMY_PLUGIN_H
+
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Dummy/plugins.qmltypes b/tests/auto/qml/qmlplugindump/data/dumper/Dummy/plugins.qmltypes
new file mode 100644
index 0000000000..da0f2f24e4
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Dummy/plugins.qmltypes
@@ -0,0 +1,17 @@
+import QtQuick.tooling 1.2
+
+// This file describes the plugin-supplied types contained in the library.
+// It is used for QML tooling purposes only.
+//
+// This file was auto-generated by:
+// 'qmlplugindump -nonrelocatable -noforceqtquick dumper.Dummy 1.0 .'
+
+Module {
+ dependencies: []
+ Component {
+ name: "Dummy"
+ prototype: "QObject"
+ exports: ["dumper.Dummy/Dummy 1.0"]
+ exportMetaObjectRevisions: [0]
+ }
+}
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Dummy/qmldir b/tests/auto/qml/qmlplugindump/data/dumper/Dummy/qmldir
new file mode 100644
index 0000000000..7d4107c040
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Dummy/qmldir
@@ -0,0 +1,3 @@
+module dumper.Dummy
+plugin Dummy
+
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Imports/CompositeImports.qml b/tests/auto/qml/qmlplugindump/data/dumper/Imports/CompositeImports.qml
new file mode 100644
index 0000000000..b1055b6992
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Imports/CompositeImports.qml
@@ -0,0 +1,5 @@
+import QtQuick 2.0
+
+QtObject {
+ property int test: 0
+}
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Imports/imports.cpp b/tests/auto/qml/qmlplugindump/data/dumper/Imports/imports.cpp
new file mode 100644
index 0000000000..a923fade2a
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Imports/imports.cpp
@@ -0,0 +1,39 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "imports.h"
+
+Imports::Imports(QObject *parent):
+ QObject(parent)
+{
+}
+
+Imports::~Imports()
+{
+}
+
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Imports/imports.h b/tests/auto/qml/qmlplugindump/data/dumper/Imports/imports.h
new file mode 100644
index 0000000000..d2b9036e4d
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Imports/imports.h
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef IMPORTS_H
+#define IMPORTS_H
+
+#include <QObject>
+
+class Imports : public QObject
+{
+ Q_OBJECT
+
+public:
+ Imports(QObject *parent = nullptr);
+ ~Imports();
+};
+
+#endif // IMPORTS_H
+
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Imports/imports.pro b/tests/auto/qml/qmlplugindump/data/dumper/Imports/imports.pro
new file mode 100644
index 0000000000..d20ea967ea
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Imports/imports.pro
@@ -0,0 +1,24 @@
+TEMPLATE = lib
+TARGET = Imports
+QT += qml
+CONFIG += qt plugin
+
+CONFIG -= debug_and_release_target
+!build_pass:qtConfig(debug_and_release): CONFIG += release
+
+TARGET = $$qtLibraryTarget($$TARGET)
+
+SOURCES += \
+ imports_plugin.cpp \
+ imports.cpp
+
+HEADERS += \
+ imports_plugin.h \
+ imports.h
+
+!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
+ cp.files = qmldir plugins.qmltypes CompositeImports.qml
+ cp.path = $$OUT_PWD
+ COPIES += cp
+}
+
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Imports/imports_plugin.cpp b/tests/auto/qml/qmlplugindump/data/dumper/Imports/imports_plugin.cpp
new file mode 100644
index 0000000000..183ba56ac1
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Imports/imports_plugin.cpp
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "imports_plugin.h"
+#include "imports.h"
+
+#include <qqml.h>
+
+void ImportsPlugin::registerTypes(const char *uri)
+{
+ // @uri dumper.imports
+ qmlRegisterType<Imports>(uri, 1, 0, "Imports");
+}
+
+
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Imports/imports_plugin.h b/tests/auto/qml/qmlplugindump/data/dumper/Imports/imports_plugin.h
new file mode 100644
index 0000000000..fd09584d47
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Imports/imports_plugin.h
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef IMPORTS_PLUGIN_H
+#define IMPORTS_PLUGIN_H
+
+#include <QQmlExtensionPlugin>
+
+class ImportsPlugin : public QQmlExtensionPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
+
+public:
+ void registerTypes(const char *uri);
+};
+
+#endif // IMPORTS_PLUGIN_H
+
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Imports/plugins.qmltypes b/tests/auto/qml/qmlplugindump/data/dumper/Imports/plugins.qmltypes
new file mode 100644
index 0000000000..937dd60a9e
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Imports/plugins.qmltypes
@@ -0,0 +1,17 @@
+import QtQuick.tooling 1.2
+
+// This file describes the plugin-supplied types contained in the library.
+// It is used for QML tooling purposes only.
+//
+// This file was auto-generated by:
+// 'qmlplugindump -nonrelocatable -noforceqtquick dumper.Imports 1.0 .'
+
+Module {
+ dependencies: ["QtQuick 2.0"]
+ Component {
+ name: "Imports"
+ prototype: "QObject"
+ exports: ["dumper.Imports/Imports 1.0"]
+ exportMetaObjectRevisions: [0]
+ }
+}
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Imports/qmldir b/tests/auto/qml/qmlplugindump/data/dumper/Imports/qmldir
new file mode 100644
index 0000000000..c9058a7f95
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Imports/qmldir
@@ -0,0 +1,3 @@
+module dumper.Imports
+plugin Imports
+CompositeImports 1.0 CompositeImports.qml
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Singleton/CompositeSingleton.qml b/tests/auto/qml/qmlplugindump/data/dumper/Singleton/CompositeSingleton.qml
new file mode 100644
index 0000000000..b47d2e98f4
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Singleton/CompositeSingleton.qml
@@ -0,0 +1,6 @@
+pragma Singleton
+import QtQuick 2.0
+
+QtObject {
+ property int test: 0
+}
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Singleton/qmldir b/tests/auto/qml/qmlplugindump/data/dumper/Singleton/qmldir
new file mode 100644
index 0000000000..6ed6d6f1d4
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Singleton/qmldir
@@ -0,0 +1,2 @@
+module dumper.Singleton
+singleton CompositeSingleton 1.0 CompositeSingleton.qml
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Versions/plugin.qmltypes b/tests/auto/qml/qmlplugindump/data/dumper/Versions/plugin.qmltypes
new file mode 100644
index 0000000000..3a33590139
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Versions/plugin.qmltypes
@@ -0,0 +1,23 @@
+import QtQuick.tooling 1.2
+
+// This file describes the plugin-supplied types contained in the library.
+// It is used for QML tooling purposes only.
+//
+// This file was auto-generated by:
+// 'qmlplugindump -nonrelocatable -noforceqtquick dumper.Versions 1.1 .'
+
+Module {
+ dependencies: []
+ Component {
+ name: "Versions"
+ prototype: "QObject"
+ exports: [
+ "dumper.Versions/Versions 1.0",
+ "dumper.Versions/Versions 1.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
+ Property { name: "foo"; type: "int" }
+ Property { name: "bar"; revision: 1; type: "int" }
+ Property { name: "baz"; revision: 2; type: "int" }
+ }
+}
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Versions/plugins.qmltypes b/tests/auto/qml/qmlplugindump/data/dumper/Versions/plugins.qmltypes
new file mode 100644
index 0000000000..3a33590139
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Versions/plugins.qmltypes
@@ -0,0 +1,23 @@
+import QtQuick.tooling 1.2
+
+// This file describes the plugin-supplied types contained in the library.
+// It is used for QML tooling purposes only.
+//
+// This file was auto-generated by:
+// 'qmlplugindump -nonrelocatable -noforceqtquick dumper.Versions 1.1 .'
+
+Module {
+ dependencies: []
+ Component {
+ name: "Versions"
+ prototype: "QObject"
+ exports: [
+ "dumper.Versions/Versions 1.0",
+ "dumper.Versions/Versions 1.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
+ Property { name: "foo"; type: "int" }
+ Property { name: "bar"; revision: 1; type: "int" }
+ Property { name: "baz"; revision: 2; type: "int" }
+ }
+}
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Versions/qmldir b/tests/auto/qml/qmlplugindump/data/dumper/Versions/qmldir
new file mode 100644
index 0000000000..a47a2a4573
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Versions/qmldir
@@ -0,0 +1,3 @@
+module dumper.Versions
+plugin Versions
+
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Versions/versions.cpp b/tests/auto/qml/qmlplugindump/data/dumper/Versions/versions.cpp
new file mode 100644
index 0000000000..3422275d78
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Versions/versions.cpp
@@ -0,0 +1,39 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "versions.h"
+
+Versions::Versions(QObject *parent):
+ QObject(parent)
+{
+}
+
+Versions::~Versions()
+{
+}
+
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Versions/versions.h b/tests/auto/qml/qmlplugindump/data/dumper/Versions/versions.h
new file mode 100644
index 0000000000..ba88f478ca
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Versions/versions.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef VERSIONS_H
+#define VERSIONS_H
+
+#include <QObject>
+
+class Versions : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int foo READ foo WRITE setFoo NOTIFY fooChanged)
+ Q_PROPERTY(int bar READ bar WRITE setBar NOTIFY barChanged REVISION 1)
+ Q_PROPERTY(int baz READ baz WRITE setBaz NOTIFY bazChanged REVISION 2)
+
+public:
+ Versions(QObject *parent = nullptr);
+ ~Versions();
+ int foo() const { return m_foo; }
+ void setFoo(int value) { m_foo = value; }
+ int bar() const { return m_bar; }
+ void setBar(int value) { m_bar = value; }
+ int baz() const { return m_baz; }
+ void setBaz(int value) { m_baz = value; }
+signals:
+ void fooChanged();
+ void barChanged();
+ void bazChanged();
+private:
+ int m_foo;
+ int m_bar;
+ int m_baz;
+};
+
+#endif // VERSIONS_H
+
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Versions/versions.pro b/tests/auto/qml/qmlplugindump/data/dumper/Versions/versions.pro
new file mode 100644
index 0000000000..6bbb9e556b
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Versions/versions.pro
@@ -0,0 +1,23 @@
+TEMPLATE = lib
+TARGET = Versions
+QT += qml
+CONFIG += qt plugin
+
+CONFIG -= debug_and_release_target
+!build_pass:qtConfig(debug_and_release): CONFIG += release
+
+TARGET = $$qtLibraryTarget($$TARGET)
+
+SOURCES += \
+ versions_plugin.cpp \
+ versions.cpp
+
+HEADERS += \
+ versions_plugin.h \
+ versions.h
+
+!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
+ cpqmldir.files = qmldir plugins.qmltypes
+ cpqmldir.path = $$OUT_PWD
+ COPIES += cpqmldir
+}
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Versions/versions_plugin.cpp b/tests/auto/qml/qmlplugindump/data/dumper/Versions/versions_plugin.cpp
new file mode 100644
index 0000000000..4bd290aff1
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Versions/versions_plugin.cpp
@@ -0,0 +1,41 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "versions_plugin.h"
+#include "versions.h"
+
+#include <qqml.h>
+
+void VersionsPlugin::registerTypes(const char *uri)
+{
+ // @uri dumper.versions
+ qmlRegisterType<Versions>(uri, 1, 0, "Versions");
+ qmlRegisterType<Versions, 1>(uri, 1, 1, "Versions");
+}
+
+
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Versions/versions_plugin.h b/tests/auto/qml/qmlplugindump/data/dumper/Versions/versions_plugin.h
new file mode 100644
index 0000000000..4ba68a8125
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Versions/versions_plugin.h
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef VERSIONS_PLUGIN_H
+#define VERSIONS_PLUGIN_H
+
+#include <QQmlExtensionPlugin>
+
+class VersionsPlugin : public QQmlExtensionPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
+
+public:
+ void registerTypes(const char *uri);
+};
+
+#endif // VERSIONS_PLUGIN_H
+
diff --git a/tests/auto/qml/qmlplugindump/qmlplugindump.pro b/tests/auto/qml/qmlplugindump/qmlplugindump.pro
index be0a0a49b6..cd33e5606e 100644
--- a/tests/auto/qml/qmlplugindump/qmlplugindump.pro
+++ b/tests/auto/qml/qmlplugindump/qmlplugindump.pro
@@ -1,9 +1,7 @@
-QT += testlib gui-private qml
-macx:CONFIG -= app_bundle
+TEMPLATE = subdirs
-CONFIG += testcase
-
-include(../../shared/util.pri)
-
-DEFINES += QT_QMLTEST_DIR=\\\"$${_PRO_FILE_PWD_}\\\"
-SOURCES += tst_qmlplugindump.cpp
+SUBDIRS += \
+ tst_qmlplugindump.pro \
+ data/dumper/Dummy/dummy.pro \
+ data/dumper/Imports/imports.pro \
+ data/dumper/Versions/versions.pro
diff --git a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
index 67a189cf5d..a326ff9702 100644
--- a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
+++ b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
@@ -45,6 +45,8 @@ private slots:
void initTestCase();
void builtins();
void singleton();
+ void plugin_data();
+ void plugin();
private:
QString qmlplugindumpPath;
@@ -105,8 +107,8 @@ void tst_qmlplugindump::singleton()
{
QProcess dumper;
QStringList args;
- args << QLatin1String("data.dumper.CompositeSingleton") << QLatin1String("1.0")
- << QLatin1String(QT_QMLTEST_DIR);
+ args << QLatin1String("dumper.CompositeSingleton") << QLatin1String("1.0")
+ << QLatin1String(QT_QMLTEST_DIR "/data");
dumper.start(qmlplugindumpPath, args);
QVERIFY2(dumper.waitForStarted(), qPrintable(dumper.errorString()));
QVERIFY2(dumper.waitForFinished(), qPrintable(dumper.errorString()));
@@ -116,6 +118,37 @@ void tst_qmlplugindump::singleton()
QVERIFY2(result.contains(QLatin1String("exportMetaObjectRevisions: [0]")), qPrintable(result));
}
+void tst_qmlplugindump::plugin_data()
+{
+ QTest::addColumn<QString>("import");
+ QTest::addColumn<QString>("version");
+ QTest::addColumn<QString>("expectedPath");
+
+ QTest::newRow("dumper.Dummy") << "dumper.Dummy" << "1.0" << testFile("dumper/Dummy/plugins.qmltypes");
+ QTest::newRow("dumper.Imports") << "dumper.Imports" << "1.0" << testFile("dumper/Imports/plugins.qmltypes");
+ QTest::newRow("dumper.Versions") << "dumper.Versions" << "1.1" << testFile("dumper/Versions/plugins.qmltypes");
+}
+
+void tst_qmlplugindump::plugin()
+{
+ QFETCH(QString, import);
+ QFETCH(QString, version);
+ QFETCH(QString, expectedPath);
+
+ QProcess dumper;
+ dumper.setWorkingDirectory(dataDirectory());
+ QStringList args = { QLatin1String("-nonrelocatable"), QLatin1String("-noforceqtquick"), import, version, QLatin1String(".") };
+ dumper.start(qmlplugindumpPath, args);
+ QVERIFY2(dumper.waitForStarted(), qPrintable(dumper.errorString()));
+ QVERIFY2(dumper.waitForFinished(), qPrintable(dumper.errorString()));
+
+ const QString &result = dumper.readAllStandardOutput();
+ QFile expectedFile(expectedPath);
+ QVERIFY2(expectedFile.open(QIODevice::ReadOnly), qPrintable(expectedFile.errorString()));
+ const QString expected = expectedFile.readAll();
+ QCOMPARE(result, expected);
+}
+
QTEST_MAIN(tst_qmlplugindump)
#include "tst_qmlplugindump.moc"
diff --git a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.pro b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.pro
new file mode 100644
index 0000000000..be0a0a49b6
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.pro
@@ -0,0 +1,9 @@
+QT += testlib gui-private qml
+macx:CONFIG -= app_bundle
+
+CONFIG += testcase
+
+include(../../shared/util.pri)
+
+DEFINES += QT_QMLTEST_DIR=\\\"$${_PRO_FILE_PWD_}\\\"
+SOURCES += tst_qmlplugindump.cpp