diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-08-28 07:34:06 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-08-28 07:34:06 +0200 |
commit | f6ab93a9f96b163cb82f4a2c0971d4fd5cc81fb4 (patch) | |
tree | a4f77a581a2ac38ff1617d046c8c37abc741a117 /tests/auto/qml/qmlcachegen | |
parent | 0ae01dec7aa0ffbb59e6e947bfa2e73ae030346a (diff) | |
parent | 8577f12bf4dfd9adfe8c5b85a3712bf1cc5ba0c3 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I0ae0a162e133cffd8fb1a2c6b70826e50f06facd
Diffstat (limited to 'tests/auto/qml/qmlcachegen')
-rw-r--r-- | tests/auto/qml/qmlcachegen/data/module.mjs | 6 | ||||
-rw-r--r-- | tests/auto/qml/qmlcachegen/data/utils.mjs | 4 | ||||
-rw-r--r-- | tests/auto/qml/qmlcachegen/qmlcachegen.pro | 4 | ||||
-rw-r--r-- | tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp | 10 |
4 files changed, 23 insertions, 1 deletions
diff --git a/tests/auto/qml/qmlcachegen/data/module.mjs b/tests/auto/qml/qmlcachegen/data/module.mjs new file mode 100644 index 0000000000..6838766329 --- /dev/null +++ b/tests/auto/qml/qmlcachegen/data/module.mjs @@ -0,0 +1,6 @@ + +import { helper } from "utils.mjs" + +export function entry() { + return helper() +} diff --git a/tests/auto/qml/qmlcachegen/data/utils.mjs b/tests/auto/qml/qmlcachegen/data/utils.mjs new file mode 100644 index 0000000000..25a1f38709 --- /dev/null +++ b/tests/auto/qml/qmlcachegen/data/utils.mjs @@ -0,0 +1,4 @@ + +export function helper() { + return "ok" +} diff --git a/tests/auto/qml/qmlcachegen/qmlcachegen.pro b/tests/auto/qml/qmlcachegen/qmlcachegen.pro index 7bd4414302..53b26ccfae 100644 --- a/tests/auto/qml/qmlcachegen/qmlcachegen.pro +++ b/tests/auto/qml/qmlcachegen/qmlcachegen.pro @@ -15,7 +15,9 @@ RESOURCES += \ data/Enums.qml \ data/componentInItem.qml \ data/jsmoduleimport.qml \ - data/script.mjs + data/script.mjs \ + data/module.mjs \ + data/utils.mjs workerscripts_test.files = \ data/worker.js \ diff --git a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp index 5462e6c8ae..741989e732 100644 --- a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp +++ b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp @@ -64,6 +64,7 @@ private slots: void qrcScriptImport(); void fsScriptImport(); void moduleScriptImport(); + void esModulesViaQJSEngine(); void enums(); @@ -604,6 +605,15 @@ void tst_qmlcachegen::moduleScriptImport() } } +void tst_qmlcachegen::esModulesViaQJSEngine() +{ + QCOMPARE(QFileInfo(":/data/module.mjs").size(), 0); + QJSEngine engine; + QJSValue module = engine.importModule(":/data/module.mjs"); + QJSValue result = module.property("entry").call(); + QCOMPARE(result.toString(), "ok"); +} + void tst_qmlcachegen::enums() { QQmlEngine engine; |