From 70f5d396be1c7d20784ef93a59a73099a02e0f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Fri, 9 Jun 2023 09:52:52 +0200 Subject: [PATCH] wasm: enable asyncify for batched tests only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- cmake/QtTestHelpers.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index b02217a53a4..2c3fc7af988 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