summaryrefslogtreecommitdiffstats
path: root/cmake/QtTestHelpers.cmake
diff options
context:
space:
mode:
authorMorten Sørvig <morten.sorvig@qt.io>2023-06-09 09:52:52 +0200
committerMorten Sørvig <morten.sorvig@qt.io>2023-06-21 20:12:42 +0200
commit70f5d396be1c7d20784ef93a59a73099a02e0f5b (patch)
tree12d92016a883933769a76890137d6a52d4668827 /cmake/QtTestHelpers.cmake
parentbf67518b53a7d843112ef3a5a44ce93e523a3739 (diff)
wasm: enable asyncify for batched tests only
It should be possible to build a test in any configuration by building Qt in that configuration, and then building the test with qt-standalone-test. Not all Qt configurations will be able to run all tests, (due to exec() calls and similar) but that's OK - some tests don't have exec() calls, and we want to be able to run tests for a given configuration to figure out how well it works. On CI we want to use batching and asyncify, so it makes sense to tie usage of asyncify to batching. Pick-to: 6.6 Change-Id: I05553d250a45c1831f43dc71a43ef02d01d70535 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Diffstat (limited to 'cmake/QtTestHelpers.cmake')
-rw-r--r--cmake/QtTestHelpers.cmake7
1 files changed, 5 insertions, 2 deletions
diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake
index b02217a53a..2c3fc7af98 100644
--- a/cmake/QtTestHelpers.cmake
+++ b/cmake/QtTestHelpers.cmake
@@ -612,10 +612,13 @@ function(qt_internal_add_test name)
list(APPEND extra_test_args "--browser_args=\"--password-store=basic\"")
list(APPEND extra_test_args "--kill_exit")
- # We always want to enable asyncify for tests, as some of them use exec
+ # Tests may require asyncify if they use exec(). Enable asyncify for
+ # batched tests since this is the configuration used on the CI system.
# Optimize for size (-Os), since asyncify tends to make the resulting
# binary very large
- target_link_options("${name}" PRIVATE "SHELL:-s ASYNCIFY" "-Os")
+ if(batch_current_test)
+ target_link_options("${name}" PRIVATE "SHELL:-s ASYNCIFY" "-Os")
+ endif()
# This tells cmake to run the tests with this script, since wasm files can't be
# executed directly