From 5fc8a377ce56d67f3b54df62bda8a45ba4416f9a Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Tue, 21 Jun 2022 15:32:00 +0200 Subject: [PATCH] Build minimal subset of tests for Android multi-ABI Qt builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an option to limit the number of tests for building and testing Android multi-ABI configurations in CI. Currently only Core tests supposed to run. Change-Id: Ibb8a41d60d108259ef2675ec54bde2482f87c8b2 Reviewed-by: Jörg Bornemann --- cmake/QtBuildInternals/QtBuildInternalsConfig.cmake | 2 +- cmake/QtBuildInternalsExtra.cmake.in | 2 ++ cmake/QtSetup.cmake | 2 ++ .../cmake_build_and_upload_test_artifacts.yaml | 9 +++++++++ tests/auto/CMakeLists.txt | 8 ++++++++ 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index 536b1a610d..aef6920f7b 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -667,7 +667,7 @@ macro(qt_build_tests) if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/auto/CMakeLists.txt") add_subdirectory(auto) endif() - if(NOT QT_BUILD_MINIMAL_STATIC_TESTS) + if(NOT QT_BUILD_MINIMAL_STATIC_TESTS AND NOT QT_BUILD_MINIMAL_ANDROID_MULTI_ABI_TESTS) if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/baseline/CMakeLists.txt") add_subdirectory(baseline) endif() diff --git a/cmake/QtBuildInternalsExtra.cmake.in b/cmake/QtBuildInternalsExtra.cmake.in index d108fbd1cd..3297d85c52 100644 --- a/cmake/QtBuildInternalsExtra.cmake.in +++ b/cmake/QtBuildInternalsExtra.cmake.in @@ -84,6 +84,8 @@ set(QT_BUILD_BENCHMARKS @QT_BUILD_BENCHMARKS@ CACHE BOOL "Build Qt Benchmarks") set(QT_BUILD_MANUAL_TESTS @QT_BUILD_MANUAL_TESTS@ CACHE BOOL "Build Qt manual tests") set(QT_BUILD_MINIMAL_STATIC_TESTS @QT_BUILD_MINIMAL_STATIC_TESTS@ CACHE BOOL "Build minimal subset of tests for static Qt builds") +set(QT_BUILD_MINIMAL_ANDROID_MULTI_ABI_TESTS @QT_BUILD_MINIMAL_ANDROID_MULTI_ABI_TESTS@ CACHE BOOL + "Build minimal subset of tests for Android multi-ABI Qt builds") set(QT_BUILD_TESTS_BY_DEFAULT @QT_BUILD_TESTS_BY_DEFAULT@ CACHE BOOL "Should tests be built as part of the default 'all' target.") diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake index c9d2655bd9..fbf5184c2b 100644 --- a/cmake/QtSetup.cmake +++ b/cmake/QtSetup.cmake @@ -253,6 +253,8 @@ unset(_qt_build_examples_as_external) option(QT_BUILD_MANUAL_TESTS "Build Qt manual tests" OFF) option(QT_BUILD_MINIMAL_STATIC_TESTS "Build minimal subset of tests for static Qt builds" OFF) +option(QT_BUILD_MINIMAL_ANDROID_MULTI_ABI_TESTS + "Build minimal subset of tests for Android multi-ABI Qt builds" OFF) ## Path used to find host tools, either when cross-compiling or just when using the tools from ## a different host build. diff --git a/coin/instructions/cmake_build_and_upload_test_artifacts.yaml b/coin/instructions/cmake_build_and_upload_test_artifacts.yaml index c1db6cc488..7fa663e4d2 100644 --- a/coin/instructions/cmake_build_and_upload_test_artifacts.yaml +++ b/coin/instructions/cmake_build_and_upload_test_artifacts.yaml @@ -48,6 +48,15 @@ instructions: property: features contains_value: "MinimalStaticTests" + # Inform CMake to build just a minimal set of tests for Android multi-ABI Qt builds. + - type: AppendToEnvironmentVariable + variableName: COIN_CMAKE_ARGS + variableValue: " -DQT_BUILD_MINIMAL_ANDROID_MULTI_ABI_TESTS=ON" + enable_if: + condition: property + property: features + contains_value: "MinimalAndroidMultiABITests" + - !include "{{qt/qtbase}}/call_cmake_for_standalone_tests.yaml" - type: ExecuteCommand command: "{{.Env.TESTS_ENV_PREFIX}} cmake --build . --parallel -v" diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index 16ea50bf63..961825d246 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -22,6 +22,14 @@ if(UIKIT) return() endif() +# Limit set of tests to run for Android multi-ABI Qt builds. +if(QT_BUILD_MINIMAL_ANDROID_MULTI_ABI_TESTS) + add_subdirectory(corelib/kernel/qmath) + add_subdirectory(widgets/effects/qpixmapfilter) + add_subdirectory(corelib/platform) + return() +endif() + # Only configure a single auto test for wasm for now # Since the linking step at this point is prohibitively long (static linking) if(WASM)