diff options
Diffstat (limited to 'tests/manual/wasm/eventloop/asyncify_exec')
-rw-r--r-- | tests/manual/wasm/eventloop/asyncify_exec/CMakeLists.txt | 8 | ||||
-rw-r--r-- | tests/manual/wasm/eventloop/asyncify_exec/main.cpp | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/tests/manual/wasm/eventloop/asyncify_exec/CMakeLists.txt b/tests/manual/wasm/eventloop/asyncify_exec/CMakeLists.txt index 09b5cdb1e9..fe7cfb9030 100644 --- a/tests/manual/wasm/eventloop/asyncify_exec/CMakeLists.txt +++ b/tests/manual/wasm/eventloop/asyncify_exec/CMakeLists.txt @@ -1,6 +1,12 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + qt_internal_add_manual_test(asyncify_exec SOURCES main.cpp - PUBLIC_LIBRARIES + 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 c3a827ac11..f09163184d 100644 --- a/tests/manual/wasm/eventloop/asyncify_exec/main.cpp +++ b/tests/manual/wasm/eventloop/asyncify_exec/main.cpp @@ -1,15 +1,13 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #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(); } |