From d5f3e7a7e319c6bd8fa8b79d8da7a6fd62b50f01 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 18 Sep 2019 08:45:43 +0200 Subject: Fix regression when using CONFIG+=QtQuickCompiler and .qrc files in subdirs Commit 41864db3b61d9e81a9fe4906918d2cd3d6d32a0c removed the processing of .qrc files that removed .qml/etc. files. Since the chaining of resources remains critical to ensure that the cached compilation units are loaded, the build system copied the input .qrc file to a new one. That mere copying caused the build to break when the copied .qrc file was not in the same directory as the original one, as file paths within the .qrc file are interpreted as relative to the .qrc file, which was now in a different location. To fix this, this patch brings back the "filtering" code that rewrites the paths to the source files in the .qrc file. Fixes: QTBUG-78253 Change-Id: Ie1d56f3248e713a964260bc2da37c9374f7b6a36 Reviewed-by: Fabian Kosmale Reviewed-by: Ulf Hermann --- tests/auto/qml/qmlcachegen/data/retain.qrc | 5 +++++ tests/auto/qml/qmlcachegen/qmlcachegen.pro | 2 +- tests/auto/qml/qmlcachegen/retain.qrc | 5 ----- tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp | 3 +-- 4 files changed, 7 insertions(+), 8 deletions(-) create mode 100644 tests/auto/qml/qmlcachegen/data/retain.qrc delete mode 100644 tests/auto/qml/qmlcachegen/retain.qrc (limited to 'tests/auto') diff --git a/tests/auto/qml/qmlcachegen/data/retain.qrc b/tests/auto/qml/qmlcachegen/data/retain.qrc new file mode 100644 index 0000000000..e1b9045fbe --- /dev/null +++ b/tests/auto/qml/qmlcachegen/data/retain.qrc @@ -0,0 +1,5 @@ + + + Retain.qml + + diff --git a/tests/auto/qml/qmlcachegen/qmlcachegen.pro b/tests/auto/qml/qmlcachegen/qmlcachegen.pro index 7bd4414302..18d3abd6bc 100644 --- a/tests/auto/qml/qmlcachegen/qmlcachegen.pro +++ b/tests/auto/qml/qmlcachegen/qmlcachegen.pro @@ -25,7 +25,7 @@ workerscripts_test.prefix = /workerscripts RESOURCES += \ workerscripts_test \ trickypaths.qrc \ - retain.qrc + data/retain.qrc # QTBUG-46375 !win32: RESOURCES += trickypaths_umlaut.qrc diff --git a/tests/auto/qml/qmlcachegen/retain.qrc b/tests/auto/qml/qmlcachegen/retain.qrc deleted file mode 100644 index e5eed9b12f..0000000000 --- a/tests/auto/qml/qmlcachegen/retain.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - data/Retain.qml - - diff --git a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp index 04f45bb902..7441aed11f 100644 --- a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp +++ b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp @@ -628,8 +628,7 @@ void tst_qmlcachegen::reproducibleCache_data() QTest::addColumn("filePath"); QDir dir(dataDirectory()); - for (const QString &entry : dir.entryList(QDir::Files)) { - QVERIFY(entry.endsWith(".qml") || entry.endsWith(".js") || entry.endsWith(".mjs")); + for (const QString &entry : dir.entryList((QStringList() << "*.qml" << "*.js" << "*.mjs"), QDir::Files)) { QTest::newRow(entry.toUtf8().constData()) << dir.filePath(entry); } } -- cgit v1.2.3