diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-08-19 16:19:21 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-08-27 01:36:01 +0200 |
commit | 40e892bca9f52449dd48db25b58e1ae5f1abcb21 (patch) | |
tree | b347ffab4448cd7ccc5e667a445b2b3ec0156282 /coin | |
parent | 5f6b0f551962e3218044886f69f0d10eaa307ce3 (diff) |
CMake: Build a subset of tests when targeting iOS in the CI
Add infrastructure to build cmake auto tests in the CI when targeting
iOS.
Currently the are only CI instructions for qtbase.
More work is needed to make it work for other repos.
With this change, we will build a single Widgets application targeting
the iOS simulator. We can't target the device SDK in the CI because
signing fails due to a missing signing certificate and provisioning
profile.
The Coin instructions will now set a QT_BUILD_ENVIRONMENT=ci env var
whose value will be checked in _qt_internal_test_expect_pass, to
ensure we build for the simulator SDK when using a universal Qt.
Without this, xcodebuild will try to build with the device SDK and
fail to build the project.
Task-number: QTBUG-95839
Change-Id: Ib39c9527b107b2004746ccbdc9d9d1d658f88c76
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 80705298ca11587782beed49c4ae55f533cfc0c2)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'coin')
4 files changed, 22 insertions, 1 deletions
diff --git a/coin/instructions/cmake_build_and_upload_test_artifacts.yaml b/coin/instructions/cmake_build_and_upload_test_artifacts.yaml index 4b3e3d46bf..1b0288d370 100644 --- a/coin/instructions/cmake_build_and_upload_test_artifacts.yaml +++ b/coin/instructions/cmake_build_and_upload_test_artifacts.yaml @@ -23,6 +23,22 @@ instructions: env_var: COIN_CMAKE_ARGS equals_value: null + # Set an informational build environment env var during the an integration's build phase. + # It can be checked during Qt and standalone tests configuration (so configure, + # qt-configure-module and qt-internal-configure-tests time). + # It's currently needed for some CMake autotest iOS-specific decisions, but it could be useful + # for other scenarios as well. + # + # A related QTEST_ENVIRONMENT env var is set during an integration's test phase. + # + # Note that CMake auto tests are configured and built during the /test/ phase, NOT the build + # phase. + # BUT, the options that will be passed to the project cmake invocation in the test phase, are + # decided during the /build/ phase. + - type: EnvironmentVariable + variableName: QT_BUILD_ENVIRONMENT + variableValue: "ci" + # Inform CMake to build just a minimal set of tests for static Qt builds. - type: AppendToEnvironmentVariable variableName: COIN_CMAKE_ARGS diff --git a/coin/instructions/cmake_setup_running_tests_env_vars.yaml b/coin/instructions/cmake_setup_running_tests_env_vars.yaml index ac909a95cc..cc1a53829b 100644 --- a/coin/instructions/cmake_setup_running_tests_env_vars.yaml +++ b/coin/instructions/cmake_setup_running_tests_env_vars.yaml @@ -1,5 +1,7 @@ type: Group instructions: + # Informs qtestblacklist.cpp that tests are run in the CI. + # A related QT_BUILD_ENVIRONMENT env var is set during an integration's build phase. - type: EnvironmentVariable variableName: QTEST_ENVIRONMENT variableValue: "ci" diff --git a/coin/instructions/coin_module_test_template_v3.yaml b/coin/instructions/coin_module_test_template_v3.yaml index fa521f0d54..c3801c2dc9 100644 --- a/coin/instructions/coin_module_test_template_v3.yaml +++ b/coin/instructions/coin_module_test_template_v3.yaml @@ -16,6 +16,9 @@ instructions: property: target.osVersion equals_value: QEMU - condition: property + property: target.osVersion + equals_value: IOS_ANY + - condition: property property: features contains_value: AndroidTestRun disable_if: diff --git a/coin/instructions/coin_qtbase_build_template_v2.yaml b/coin/instructions/coin_qtbase_build_template_v2.yaml index 503916b417..d6c8bea247 100644 --- a/coin/instructions/coin_qtbase_build_template_v2.yaml +++ b/coin/instructions/coin_qtbase_build_template_v2.yaml @@ -26,7 +26,7 @@ instructions: enable_if: condition: property property: target.osVersion - in_values: [Android_ANY, QEMU] + in_values: [Android_ANY, QEMU, IOS_ANY] enable_if: condition: or conditions: |