aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
diff options
context:
space:
mode:
authorAndreas Buhr <andreas.buhr@qt.io>2022-04-26 11:38:34 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-05-07 13:39:57 +0000
commit087dc42475ad5db57afa01ff84309d680a882d2d (patch)
tree68c63d71622794a3cd4df3ae4cdd1a3192b77ced /tests/auto/qml
parent47e0a288f688c512b8f0b8aed41d4d544c315340 (diff)
Fix tst_qqmltranslation on Android
tst_qqmltranslation::translation(qrc) had a problem with incorrectly generated qrc file. This test has two qrc files - one for all test data, as it's usually done for Android, and another one - to test that custom prefixes work properly. The latter resource file had an invalid alias (which included the "data" dir). The reason for the error was that the same data file was already process when the global resources qrc file was generated. At that time the alias prefix was set, and then reused. To fix it we need to explicitly reset the QT_RESOURCE_ALIAS property before generating the second qrc file. Task-number: QTBUG-101865 Change-Id: Ibd7e2a41ffffc3601db9722d155932a3cc9a9b54 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> (cherry picked from commit 8976a55dac7436dc2533714319a4c4e4e7f674de) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/auto/qml')
-rw-r--r--tests/auto/qml/qqmltranslation/CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmltranslation/CMakeLists.txt b/tests/auto/qml/qqmltranslation/CMakeLists.txt
index f685e07d9a..396eed518e 100644
--- a/tests/auto/qml/qqmltranslation/CMakeLists.txt
+++ b/tests/auto/qml/qqmltranslation/CMakeLists.txt
@@ -37,6 +37,13 @@ set_source_files_properties(
)
# special case end
+# On platforms where TESTDATA is embedded into resources (Android, iOS and
+# INTEGRITY), the QT_RESOURCE_ALIAS property was previously set when processing
+# TESTDATA, so we need to reset it. Otherwise the wrong alias will be written
+# to introspect.qrc, and the related test will fail.
+set_source_files_properties(${translation_resource_files} PROPERTIES
+ QT_RESOURCE_ALIAS "NOTFOUND")
+
qt_internal_add_resource(tst_qqmltranslation "translation"
PREFIX
"/"