aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/testdata-qt
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2017-06-22 15:54:06 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2017-07-17 13:19:37 +0000
commitaaaeea6a55ca1242689f4cf16e3aac173ff7d8c4 (patch)
tree8922c7b2f74c2c6814a2f229f8a6a2f8cb36e799 /tests/auto/blackbox/testdata-qt
parentd479de3d9b6042bf14a905ec3ba3bf2a451f7b55 (diff)
Add support for qmlcachegen
[ChangeLog] Support for qmlcachegen has been added. To enable it in a QML project, set Qt.qml.generateCacheFiles to true. Task-number: QBS-1132 Change-Id: I061eb1afd8994306958376e1cd7f5a98a8f4b03e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests/auto/blackbox/testdata-qt')
-rw-r--r--tests/auto/blackbox/testdata-qt/cached-qml/MainForm.ui.qml29
-rw-r--r--tests/auto/blackbox/testdata-qt/cached-qml/cached-qml.qbs30
-rw-r--r--tests/auto/blackbox/testdata-qt/cached-qml/main.cpp14
-rw-r--r--tests/auto/blackbox/testdata-qt/cached-qml/main.qml17
-rw-r--r--tests/auto/blackbox/testdata-qt/cached-qml/qml.qrc7
-rw-r--r--tests/auto/blackbox/testdata-qt/cached-qml/stuff.js1
6 files changed, 98 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata-qt/cached-qml/MainForm.ui.qml b/tests/auto/blackbox/testdata-qt/cached-qml/MainForm.ui.qml
new file mode 100644
index 000000000..3fe8b6f04
--- /dev/null
+++ b/tests/auto/blackbox/testdata-qt/cached-qml/MainForm.ui.qml
@@ -0,0 +1,29 @@
+import QtQuick 2.6
+
+Rectangle {
+ property alias mouseArea: mouseArea
+ property alias textEdit: textEdit
+
+ width: 360
+ height: 360
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ }
+
+ TextEdit {
+ id: textEdit
+ text: qsTr("Enter some text...")
+ verticalAlignment: Text.AlignVCenter
+ anchors.top: parent.top
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.topMargin: 20
+ Rectangle {
+ anchors.fill: parent
+ anchors.margins: -10
+ color: "transparent"
+ border.width: 1
+ }
+ }
+}
diff --git a/tests/auto/blackbox/testdata-qt/cached-qml/cached-qml.qbs b/tests/auto/blackbox/testdata-qt/cached-qml/cached-qml.qbs
new file mode 100644
index 000000000..2a7171fc2
--- /dev/null
+++ b/tests/auto/blackbox/testdata-qt/cached-qml/cached-qml.qbs
@@ -0,0 +1,30 @@
+import qbs
+
+CppApplication {
+ name: "app"
+ Depends { name: "Qt.core" }
+ Depends { name: "Qt.quick" }
+ Depends { name: "Qt.qml" }
+ Qt.qml.generateCacheFiles: true
+ Qt.qml.cacheFilesInstallDir: "data"
+
+ files: [
+ "main.cpp",
+ "MainForm.ui.qml",
+ "main.qml",
+ "stuff.js"
+ ]
+
+ Group {
+ fileTagsFilter: product.type
+ qbs.install: true
+ }
+
+ // Install the C++ sources to tell the blackbox test that Qt.qmlcache is not available.
+ Group {
+ condition: !Qt.qml.cachingEnabled
+ fileTagsFilter: ["cpp"]
+ qbs.install: true
+ qbs.installDir: "data"
+ }
+}
diff --git a/tests/auto/blackbox/testdata-qt/cached-qml/main.cpp b/tests/auto/blackbox/testdata-qt/cached-qml/main.cpp
new file mode 100644
index 000000000..ac82ac0cf
--- /dev/null
+++ b/tests/auto/blackbox/testdata-qt/cached-qml/main.cpp
@@ -0,0 +1,14 @@
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+
+ QQmlApplicationEngine engine;
+ engine.load(QUrl(qApp->applicationDirPath() + QStringLiteral("/data/main.qml")));
+ if (engine.rootObjects().isEmpty())
+ return -1;
+
+ return app.exec();
+}
diff --git a/tests/auto/blackbox/testdata-qt/cached-qml/main.qml b/tests/auto/blackbox/testdata-qt/cached-qml/main.qml
new file mode 100644
index 000000000..f5f32f6bd
--- /dev/null
+++ b/tests/auto/blackbox/testdata-qt/cached-qml/main.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.6
+import QtQuick.Window 2.2
+import "stuff.js" as Stuff
+
+Window {
+ visible: true
+ width: 640
+ height: 480
+ title: Stuff.title()
+
+ MainForm {
+ anchors.fill: parent
+ mouseArea.onClicked: {
+ console.log(qsTr('Clicked on background. Text: "' + textEdit.text + '"'))
+ }
+ }
+}
diff --git a/tests/auto/blackbox/testdata-qt/cached-qml/qml.qrc b/tests/auto/blackbox/testdata-qt/cached-qml/qml.qrc
new file mode 100644
index 000000000..57c8988b9
--- /dev/null
+++ b/tests/auto/blackbox/testdata-qt/cached-qml/qml.qrc
@@ -0,0 +1,7 @@
+<!DOCTYPE RCC>
+<RCC version="1.0">
+ <qresource prefix="/">
+ <file>main.qml</file>
+ <file>MainForm.ui.qml</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/blackbox/testdata-qt/cached-qml/stuff.js b/tests/auto/blackbox/testdata-qt/cached-qml/stuff.js
new file mode 100644
index 000000000..3c19feacd
--- /dev/null
+++ b/tests/auto/blackbox/testdata-qt/cached-qml/stuff.js
@@ -0,0 +1 @@
+function title() { return "Wello Horld!"; }