summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Buhr <andreas@andreasbuhr.de>2022-04-25 16:45:44 +0200
committerAndreas Buhr <andreas@andreasbuhr.de>2022-04-25 19:39:49 +0200
commit9eb8f202b6cb53e39ec38b14c5e5b4540139eda6 (patch)
tree10a93c4814c31dfefddddbfa1c5b198fc8bc9537
parent73284aa3cfdb4178230b83b2361f8056e2f54c44 (diff)
downloadqtdeclarative-9eb8f202b6cb53e39ec38b14c5e5b4540139eda6.tar.gz
Fix tst_qqmlimport on Android
This patch moves a code snippet from a string into its own file, so qmlimportscanner can see it and pull its dependencies. Second, this patch enables removal of '\r' in an expected log message, as this seems required now. Pick-to: 6.2 6.3 Task-number: QTBUG-101865 Change-Id: I25b35e166a7edb6f3aaaa92a3134347804d1c6c1 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
-rw-r--r--tests/auto/qml/qqmlimport/data/importQtQuickTooling.qml4
-rw-r--r--tests/auto/qml/qqmlimport/tst_qqmlimport.cpp5
2 files changed, 6 insertions, 3 deletions
diff --git a/tests/auto/qml/qqmlimport/data/importQtQuickTooling.qml b/tests/auto/qml/qqmlimport/data/importQtQuickTooling.qml
new file mode 100644
index 0000000000..5b094adfff
--- /dev/null
+++ b/tests/auto/qml/qqmlimport/data/importQtQuickTooling.qml
@@ -0,0 +1,4 @@
+import QtQuick.tooling
+
+Property {
+}
diff --git a/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp b/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp
index 04c6c21bcb..360558a984 100644
--- a/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp
+++ b/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp
@@ -172,7 +172,7 @@ void tst_QQmlImport::testDesignerSupported()
QVERIFY(window->errors().isEmpty());
QString warningString("%1:30:1: module does not support the designer \"MyPluginUnsupported\" \n import MyPluginUnsupported 1.0\r \n ^ ");
-#if !defined(Q_OS_WIN) && !defined(Q_OS_ANDROID)
+#if !defined(Q_OS_WIN)
warningString.remove('\r');
#endif
warningString = warningString.arg(testFileUrl("testfile_unsupported.qml").toString());
@@ -409,10 +409,9 @@ void tst_QQmlImport::removeDynamicPlugin()
QQmlEngine engine;
{
// Load something that adds a dynamic plugin
- QQmlComponent component(&engine);
+ QQmlComponent component(&engine, testFileUrl("importQtQuickTooling.qml"));
// Make sure to use something other than QtTest here, since the !plugins.isEmpty()
// check will fail if we do.
- component.setData(QByteArray("import QtQuick.tooling; Property{}"), QUrl());
QVERIFY2(component.isReady(), qPrintable(component.errorString()));
}
QQmlImportDatabase *imports = &QQmlEnginePrivate::get(&engine)->importDatabase;