aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-06-26 15:44:23 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-06-30 09:39:55 +0000
commit41890402db086f4c61e052cef7659eb6b003dc77 (patch)
treed917de227629d6a0ea55f9e3c0897c457fe55bdd /tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
parent8bd6342639721b7db08acf554c6bcd3e7ab04cb6 (diff)
Revive QTQUICK_COMPILER_SKIPPED_RESOURCES
There are valid reasons not to compile some resources with qmlcachegen. Pick-to: 5.15 Fixes: QTBUG-85243 Change-Id: I9a1233864ed5dda0c264e61db596a9d8c80ea1f3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp')
-rw-r--r--tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
index c6ec2eb780..652942b243 100644
--- a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
+++ b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
@@ -56,6 +56,7 @@ private slots:
void functionExpressions();
void versionChecksForAheadOfTimeUnits();
void retainedResources();
+ void skippedResources();
void workerScripts();
@@ -411,6 +412,19 @@ void tst_qmlcachegen::retainedResources()
QVERIFY(file.readAll().startsWith("import QtQml 2.0"));
}
+void tst_qmlcachegen::skippedResources()
+{
+ QFile file(":/not/Skip.qml");
+ QVERIFY(file.open(QIODevice::ReadOnly));
+ QVERIFY(file.readAll().startsWith("import QtQml 2.0"));
+
+ QQmlMetaType::CachedUnitLookupError error = QQmlMetaType::CachedUnitLookupError::NoError;
+ const QQmlPrivate::CachedQmlUnit *unit = QQmlMetaType::findCachedCompilationUnit(
+ QUrl("qrc:/not/Skip.qml"), &error);
+ QCOMPARE(unit, nullptr);
+ QCOMPARE(error, QQmlMetaType::CachedUnitLookupError::NoUnitFound);
+}
+
void tst_qmlcachegen::workerScripts()
{
QVERIFY(QFile::exists(":/workerscripts/data/worker.js"));