diff options
Diffstat (limited to 'tests/auto/qml/qmlcachegen')
-rw-r--r-- | tests/auto/qml/qmlcachegen/Retain.qml | 2 | ||||
-rw-r--r-- | tests/auto/qml/qmlcachegen/qmlcachegen.pro | 3 | ||||
-rw-r--r-- | tests/auto/qml/qmlcachegen/retain.qrc | 5 | ||||
-rw-r--r-- | tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp | 8 |
4 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcachegen/Retain.qml b/tests/auto/qml/qmlcachegen/Retain.qml new file mode 100644 index 0000000000..0e69012662 --- /dev/null +++ b/tests/auto/qml/qmlcachegen/Retain.qml @@ -0,0 +1,2 @@ +import QtQml 2.0 +QtObject {} diff --git a/tests/auto/qml/qmlcachegen/qmlcachegen.pro b/tests/auto/qml/qmlcachegen/qmlcachegen.pro index 7f7b3128cf..c7820ac1cd 100644 --- a/tests/auto/qml/qmlcachegen/qmlcachegen.pro +++ b/tests/auto/qml/qmlcachegen/qmlcachegen.pro @@ -21,4 +21,7 @@ RESOURCES += Enums.qml RESOURCES += jsmoduleimport.qml script.mjs +RESOURCES += retain.qrc +QTQUICK_COMPILER_RETAINED_RESOURCES += retain.qrc + QT += core-private qml-private testlib diff --git a/tests/auto/qml/qmlcachegen/retain.qrc b/tests/auto/qml/qmlcachegen/retain.qrc new file mode 100644 index 0000000000..af042b25d8 --- /dev/null +++ b/tests/auto/qml/qmlcachegen/retain.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/"> + <file>Retain.qml</file> + </qresource> +</RCC> diff --git a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp index 97ac466e94..8cfa4cb6af 100644 --- a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp +++ b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp @@ -52,6 +52,7 @@ private slots: void aheadOfTimeCompilation(); void functionExpressions(); void versionChecksForAheadOfTimeUnits(); + void retainedResources(); void workerScripts(); @@ -392,6 +393,13 @@ void tst_qmlcachegen::versionChecksForAheadOfTimeUnits() QQmlMetaType::removeCachedUnitLookupFunction(testHandler); } +void tst_qmlcachegen::retainedResources() +{ + QFile file(":/Retain.qml"); + QVERIFY(file.open(QIODevice::ReadOnly)); + QVERIFY(file.readAll().startsWith("import QtQml 2.0")); +} + void tst_qmlcachegen::workerScripts() { QVERIFY(QFile::exists(":/workerscripts/worker.js")); |