Skip to content

Commit

Permalink
Build minimal subset of tests for Android multi-ABI Qt builds
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
semlanik committed Aug 2, 2022
1 parent aa69457 commit 5fc8a37
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions cmake/QtBuildInternalsExtra.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
2 changes: 2 additions & 0 deletions cmake/QtSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 9 additions & 0 deletions coin/instructions/cmake_build_and_upload_test_artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions tests/auto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5fc8a37

Please sign in to comment.