summaryrefslogtreecommitdiffstats
path: root/tests/manual/wasm/eventloop/asyncify_exec
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/wasm/eventloop/asyncify_exec')
-rw-r--r--tests/manual/wasm/eventloop/asyncify_exec/CMakeLists.txt3
-rw-r--r--tests/manual/wasm/eventloop/asyncify_exec/main.cpp10
2 files changed, 5 insertions, 8 deletions
diff --git a/tests/manual/wasm/eventloop/asyncify_exec/CMakeLists.txt b/tests/manual/wasm/eventloop/asyncify_exec/CMakeLists.txt
index f8328660b20..28825e38a0e 100644
--- a/tests/manual/wasm/eventloop/asyncify_exec/CMakeLists.txt
+++ b/tests/manual/wasm/eventloop/asyncify_exec/CMakeLists.txt
@@ -7,3 +7,6 @@ qt_internal_add_manual_test(asyncify_exec
LIBRARIES
Qt::Core
)
+
+# Enable asyncify for this test. Also enable optimizations in order to reduce the binary size.
+target_link_options(asyncify_exec PUBLIC -sASYNCIFY -Os)
diff --git a/tests/manual/wasm/eventloop/asyncify_exec/main.cpp b/tests/manual/wasm/eventloop/asyncify_exec/main.cpp
index c3a827ac115..ab3018c12ec 100644
--- a/tests/manual/wasm/eventloop/asyncify_exec/main.cpp
+++ b/tests/manual/wasm/eventloop/asyncify_exec/main.cpp
@@ -2,14 +2,12 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QtCore>
-// This test shows how to asyncify enables blocking
-// the main thread on QEventLoop::exec(), while event
-// provessing continues.
+// This test shows how to use asyncify to enable blocking the main
+// thread on QEventLoop::exec(), while event processing continues.
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
-#ifdef QT_HAVE_EMSCRIPTEN_ASYNCIFY
QTimer::singleShot(1000, []() {
QEventLoop loop;
@@ -22,10 +20,6 @@ int main(int argc, char **argv)
loop.exec();
qDebug() << "Returned from QEventLoop::exec()";
});
-#else
- qDebug() << "This test requires Emscripten asyncify. To enable,"
- << "configure Qt with -device-option QT_EMSCRIPTEN_ASYNCIFY=1";
-#endif
app.exec();
}