diff options
author | Even Oscar Andersen <even.oscar.andersen@qt.io> | 2024-02-07 10:13:21 +0100 |
---|---|---|
committer | Even Oscar Andersen <even.oscar.andersen@qt.io> | 2024-02-13 20:53:33 +0000 |
commit | 5c05f5cd7fbf7502ac2f263d2786ad58d2e469f7 (patch) | |
tree | 0acdb939b6984e5afa2e79e87c86acff5cfaac59 /cmake | |
parent | 53eb8dd06d51c1b21f6a40c7dadce17a85fc21c4 (diff) |
wasm: Make sure emrun.bat is used when running autotests on windows
The test system tried to run emrun (No .bat). This failed with a
file-not-found error on windows.
Also there was a test for (WIN32) when deciding to use cmd /c.
This test has been updated to (CMAKE_HOST_WIN32)
Also the aforementioned cmd /c was not present in the test run
output. It has been added.
Fixes: QTBUG-121996
Change-Id: Ib3c053949865038ad43abd479402f5e8e3c015ac
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Piotr WierciĆski <piotr.wiercinski@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtPublicTestHelpers.cmake | 4 | ||||
-rw-r--r-- | cmake/QtTestHelpers.cmake | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/cmake/QtPublicTestHelpers.cmake b/cmake/QtPublicTestHelpers.cmake index 0cfbfab404..771911c5d5 100644 --- a/cmake/QtPublicTestHelpers.cmake +++ b/cmake/QtPublicTestHelpers.cmake @@ -64,7 +64,7 @@ is not specified") #Escaping environment variables before expand them by file GENERATE string(REPLACE "\\" "\\\\" environment_extras "${environment_extras}") - if(WIN32) + if(CMAKE_HOST_WIN32) # It's necessary to call actual test inside 'cmd.exe', because 'execute_process' uses # SW_HIDE to avoid showing a console window, it affects other GUI as well. # See https://gitlab.kitware.com/cmake/cmake/-/issues/17690 for details. @@ -97,7 +97,7 @@ execute_process(COMMAND ${extra_runner} ${arg_COMMAND} ) ${post_run} if(NOT result EQUAL 0) - string(JOIN \" \" full_command ${arg_COMMAND}) + string(JOIN \" \" full_command ${extra_runner} ${arg_COMMAND}) message(FATAL_ERROR \"\${full_command} execution failed with exit code \${result}.\") endif()" ) diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index 934ac0ec9f..d54da875cd 100644 --- a/cmake/QtTestHelpers.cmake +++ b/cmake/QtTestHelpers.cmake @@ -676,7 +676,11 @@ function(qt_internal_add_test name) # This tells cmake to run the tests with this script, since wasm files can't be # executed directly - set_property(TARGET "${name}" PROPERTY CROSSCOMPILING_EMULATOR "emrun") + if (CMAKE_HOST_WIN32) + set_property(TARGET "${name}" PROPERTY CROSSCOMPILING_EMULATOR "emrun.bat") + else() + set_property(TARGET "${name}" PROPERTY CROSSCOMPILING_EMULATOR "emrun") + endif() else() if(arg_QMLTEST AND NOT arg_SOURCES) set(test_working_dir "${CMAKE_CURRENT_SOURCE_DIR}") |