summaryrefslogtreecommitdiffstats
path: root/tests/manual/wasm/qtloader_integration/CMakeLists.txt
diff options
context:
space:
mode:
authorMikolaj Boc <mikolaj.boc@qt.io>2023-02-23 10:14:23 +0100
committerMorten Sørvig <morten.sorvig@qt.io>2023-06-05 23:14:28 +0200
commitb9491daad0ed1c4b9c74e0c3b23f87eb7ad4f37d (patch)
tree6d136051f07471cc40a12c20ed14d7b088cb9e61 /tests/manual/wasm/qtloader_integration/CMakeLists.txt
parent821a4234d04043417d0880f23479c170b062ea58 (diff)
Modernize the qtloader
This is a minimal version of qtloader. The load function accepts the same arguments as emscripten runtime with a few additions: - qt.environment - qt.onExit - qt.containerElements - qt.fontDpi - qt.onLoaded - qt.entryFunction State handling has been removed in favor of making the load async (assume loading when the promise is live). Public APIs getting crashed status, exit text and code have been refactored into the new qt.onExit event fed to load. No need for keeping the state in the loader. The loader is integration-tested. A test module with test APIs has been created as a test harness. The runtime APIs exposed by Qt (font dpi and screen API) are handled by the qtloader seamlessly. Change-Id: Iaee65702667da0349a475feae6b83244d966d98d Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'tests/manual/wasm/qtloader_integration/CMakeLists.txt')
-rw-r--r--tests/manual/wasm/qtloader_integration/CMakeLists.txt39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/manual/wasm/qtloader_integration/CMakeLists.txt b/tests/manual/wasm/qtloader_integration/CMakeLists.txt
new file mode 100644
index 0000000000..24c5607cd8
--- /dev/null
+++ b/tests/manual/wasm/qtloader_integration/CMakeLists.txt
@@ -0,0 +1,39 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_manual_test(tst_qtloader_integration
+ GUI
+ SOURCES
+ main.cpp
+ LIBRARIES
+ Qt::Core
+ Qt::Gui
+ Qt::GuiPrivate
+ Qt::Widgets
+)
+
+set_target_properties(tst_qtloader_integration PROPERTIES QT_WASM_EXTRA_EXPORTED_METHODS "ENV")
+
+add_custom_command(
+ TARGET tst_qtloader_integration POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy
+ ${CMAKE_CURRENT_SOURCE_DIR}/tst_qtloader_integration.html
+ ${CMAKE_CURRENT_BINARY_DIR}/tst_qtloader_integration.html)
+
+add_custom_command(
+ TARGET tst_qtloader_integration POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/plugins/platforms/wasm/qtloader.js
+ ${CMAKE_CURRENT_BINARY_DIR}/qtloader.js)
+
+add_custom_command(
+ TARGET tst_qtloader_integration POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy
+ ${CMAKE_CURRENT_SOURCE_DIR}/../shared/testrunner.js
+ ${CMAKE_CURRENT_BINARY_DIR}/testrunner.js)
+
+add_custom_command(
+ TARGET tst_qtloader_integration POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy
+ ${CMAKE_CURRENT_SOURCE_DIR}/test_body.js
+ ${CMAKE_CURRENT_BINARY_DIR}/test_body.js)