From e1d088b1e84c6df9b7626abfa28a6e816930abea Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Tue, 25 Feb 2025 15:55:22 +0100 Subject: [PATCH] Enable building tests on WoA cross compile Note this change has no impact on it own on current integrations, as it barely adds tests compilation. It is required for qtwebengine on WoA story. Do not run some tests: (required for qt5 patch introducing woa test node) * cmake test as host tools are provided by mingw, but tests are run natively by WoA platform. * dbus as this does not run natively on Woa anyway due to missing dbus service. Change-Id: Ifdb3e1b76a7feb906a9031815984c716618e3882 Reviewed-by: Alexandru Croitor (cherry picked from commit 04d17b2e229cee5e63596832b021c2316d9e4a05) --- coin/instructions/coin_module_build_template_v2.yaml | 8 +------- coin/instructions/coin_qtbase_build_template_v2.yaml | 8 +------- tests/auto/CMakeLists.txt | 2 +- tests/auto/cmake/CMakeLists.txt | 8 ++++++++ 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/coin/instructions/coin_module_build_template_v2.yaml b/coin/instructions/coin_module_build_template_v2.yaml index 44a8bae5ac9..210fd4a3161 100644 --- a/coin/instructions/coin_module_build_template_v2.yaml +++ b/coin/instructions/coin_module_build_template_v2.yaml @@ -55,13 +55,7 @@ instructions: - type: Group instructions: - !include "{{qt/qtbase}}/cmake_cross_compilation_module_build_instructions.yaml" - - type: Group - instructions: - - !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts_target.yaml" - enable_if: - condition: property - property: target.osVersion - in_values: [Android_ANY, QEMU, IOS_ANY, QNX_710, WebAssembly, INTEGRITY, VxWorks] + - !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts_target.yaml" enable_if: condition: or conditions: diff --git a/coin/instructions/coin_qtbase_build_template_v2.yaml b/coin/instructions/coin_qtbase_build_template_v2.yaml index 1d58f9e05d8..5bc615808e9 100644 --- a/coin/instructions/coin_qtbase_build_template_v2.yaml +++ b/coin/instructions/coin_qtbase_build_template_v2.yaml @@ -46,13 +46,7 @@ instructions: property: target.arch equals_value: Multi - !include "{{qt/qtbase}}/prepare_android_multi_abi_env.yaml" - - type: Group - instructions: - - !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts_target.yaml" - enable_if: - condition: property - property: target.osVersion - in_values: [Android_ANY, QEMU, IOS_ANY, QNX_710, WebAssembly, INTEGRITY, VxWorks] + - !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts_target.yaml" enable_if: condition: or conditions: diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index f7dfbb5c817..6cb99b4bfea 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -7,7 +7,7 @@ set(run_dbus_tests OFF) if (QT_FEATURE_dbus) set(run_dbus_tests ON) - if(NOT CMAKE_CROSSCOMPILING AND TARGET Qt::DBus) + if((NOT CMAKE_CROSSCOMPILING OR WIN32) AND TARGET Qt::DBus) execute_process(COMMAND dbus-send --session --type=signal / local.AutotestCheck.Hello TIMEOUT 5 RESULT_VARIABLE dbus_session_test diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index 59d19fabf82..d3059269fca 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -75,6 +75,14 @@ if(UNIX AND NOT APPLE AND NOT WIN32 AND CMAKE_CROSSCOMPILING AND NOT QT_ENABLE_C return() endif() +# On coin for WoA we have hackish setup to reduce integration time where +# host tools are deliver by mingw, build is done as cross build +# and tests run natively on WoA, meaning tooling can not execute natively. +if(WIN32 AND CMAKE_CROSSCOMPILING) + message(STATUS "Running CMake tests is disabled when cross-compiling to WoA") + return() +endif() + set(required_packages Core Network Xml Sql Test TestInternalsPrivate) set(optional_packages DBus Gui Widgets PrintSupport OpenGL Concurrent)