aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-03-26 13:24:43 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-03-27 18:44:32 +0000
commite09a02fac0d1ecbffeebcb2012ecc659c8986a4e (patch)
tree3a78fa3f024ff606204cacb947f83e9e7df32dd4 /tests
parent3ae0e1504e94e5c531fa5e919cc8e9f503a5bd34 (diff)
Fix CONFIG+=qtquickcompiler with paths that contain spaces
Map spaces to underscores as well. Task-number: QTBUG-54683 Change-Id: Id73c086a2845111623df631c06733ba2b42249e0 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qmlcachegen/qmlcachegen.pro2
-rw-r--r--tests/auto/qml/qmlcachegen/trickypaths.qml4
-rw-r--r--tests/auto/qml/qmlcachegen/trickypaths.qrc5
-rw-r--r--tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp14
4 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcachegen/qmlcachegen.pro b/tests/auto/qml/qmlcachegen/qmlcachegen.pro
index bad912c781..a2f963e8c3 100644
--- a/tests/auto/qml/qmlcachegen/qmlcachegen.pro
+++ b/tests/auto/qml/qmlcachegen/qmlcachegen.pro
@@ -10,4 +10,6 @@ RESOURCES += workerscripts_test
RESOURCES += versionchecks.qml
+RESOURCES += trickypaths.qrc
+
QT += core-private qml-private testlib
diff --git a/tests/auto/qml/qmlcachegen/trickypaths.qml b/tests/auto/qml/qmlcachegen/trickypaths.qml
new file mode 100644
index 0000000000..0836808dc2
--- /dev/null
+++ b/tests/auto/qml/qmlcachegen/trickypaths.qml
@@ -0,0 +1,4 @@
+import QtQml 2.0
+QtObject {
+ property int success: 42
+}
diff --git a/tests/auto/qml/qmlcachegen/trickypaths.qrc b/tests/auto/qml/qmlcachegen/trickypaths.qrc
new file mode 100644
index 0000000000..271cf6571e
--- /dev/null
+++ b/tests/auto/qml/qmlcachegen/trickypaths.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/directory with spaces">
+<file alias="file name with spaces.qml">trickypaths.qml</file>
+</qresource>
+</RCC>
diff --git a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
index 1c05005c90..5c1692f086 100644
--- a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
+++ b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
@@ -52,6 +52,8 @@ private slots:
void versionChecksForAheadOfTimeUnits();
void workerScripts();
+
+ void trickyPaths();
};
// A wrapper around QQmlComponent to ensure the temporary reference counts
@@ -402,6 +404,18 @@ void tst_qmlcachegen::functionExpressions()
QCOMPARE(obj->property("h_connections_handler_called").toBool(), true);
}
+void tst_qmlcachegen::trickyPaths()
+{
+ QString pathWithSpaces(QStringLiteral(":/directory with spaces/file name with spaces.qml"));
+ QVERIFY2(QFile::exists(pathWithSpaces), qPrintable(pathWithSpaces));
+ QCOMPARE(QFileInfo(pathWithSpaces).size(), 0);
+ QQmlEngine engine;
+ QQmlComponent component(&engine, QUrl("qrc" + pathWithSpaces));
+ QScopedPointer<QObject> obj(component.create());
+ QVERIFY(!obj.isNull());
+ QCOMPARE(obj->property("success").toInt(), 42);
+}
+
QTEST_GUILESS_MAIN(tst_qmlcachegen)
#include "tst_qmlcachegen.moc"