diff options
author | Dominik Holland <dominik.holland@qt.io> | 2024-02-28 11:03:58 +0100 |
---|---|---|
committer | Dominik Holland <dominik.holland@qt.io> | 2024-02-28 13:21:03 +0100 |
commit | a8479d1039ecc9de0e9f36efd905d1d299328d27 (patch) | |
tree | 5a8b4de86040b0a5d5f2d4be1a0cc59625a2d5f7 | |
parent | f437fe32626f1c5a880c7f5d7937ad150b9bff6b (diff) |
coin: Add special build instruction for a lcov code coverage build
Change-Id: I634a21d6d8026146c450638eae949468f7415a9c
Reviewed-by: Robert Griebl <robert.griebl@qt.io>
-rw-r--r-- | coin/instructions/cmake_module_lcov_code_coverage.yaml | 42 | ||||
-rw-r--r-- | coin/module_config.yaml | 32 |
2 files changed, 72 insertions, 2 deletions
diff --git a/coin/instructions/cmake_module_lcov_code_coverage.yaml b/coin/instructions/cmake_module_lcov_code_coverage.yaml new file mode 100644 index 00000000..15056ab9 --- /dev/null +++ b/coin/instructions/cmake_module_lcov_code_coverage.yaml @@ -0,0 +1,42 @@ +type: Group +instructions: + - !include "{{qt/qtbase}}/coin_module_test_template_common.yaml" + - type: ChangeDirectory + directory: "{{.SourceDir}}_standalone_tests" + - type: EnvironmentVariable + variableName: CMAKE_BUILD_TIMEOUT + variableValue: "6000" + enable_if: + condition: runtime + env_var: CMAKE_BUILD_TIMEOUT + equals_value: null + - type: EnvironmentVariable + variableName: CMAKE_BUILD_OUTPUT_TIMEOUT + variableValue: "1200" + enable_if: + condition: runtime + env_var: CMAKE_BUILD_OUTPUT_TIMEOUT + equals_value: null + - type: ExecuteCommand + command: "{{.Env.CONFIGURE_ENV_PREFIX}} ninja check_coverage" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + ignoreExitCode: false + maxTimeInSeconds: 10800 + maxTimeBetweenOutput: 900 + userMessageOnFailure: > + Failed to run tests. + + - type: MakeDirectory + directory: "upload" + - type: ExecuteCommand + command: "zip -r upload/coverage-report.zip coverage-report" + ignoreExitCode: false + maxTimeInSeconds: 10800 + maxTimeBetweenOutput: 900 + userMessageOnFailure: > + Failed to zip the coverage-report. + + - type: ScheduleUploadTestResults + - type: EnvironmentVariable + variableName: COIN_CTEST_RESULTSDIR + variableValue: "{{.SourceDir}}_standalone_tests/upload" diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 750c857b..5c04c15e 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -54,10 +54,38 @@ instructions: condition: property property: features contains_value: Axivion_qtinterfaceframework + # Enable a lcov code-coverage build + - type: AppendToEnvironmentVariable + variableName: NON_QTBASE_CMAKE_ARGS + variableValue: " -DIF_COVERAGE=ON" + enable_if: + condition: property + property: features + contains_value: lcov + - type: AppendToEnvironmentVariable + variableName: COMMON_TEST_CMAKE_ARGS + variableValue: " -DIF_COVERAGE=ON" + enable_if: + condition: property + property: features + contains_value: lcov - type: Group instructions: - !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml" + - type: Group + instructions: + - !include "{{qt/qtinterfaceframework}}/cmake_module_lcov_code_coverage.yaml" + enable_if: + condition: property + property: features + contains_value: lcov Test: - - !include "{{qt/qtbase}}/coin_module_test_template_v3.yaml" - - !include "{{qt/qtbase}}/coin_module_test_docs.yaml" + - type: Group + instructions: + - !include "{{qt/qtbase}}/coin_module_test_template_v3.yaml" + - !include "{{qt/qtbase}}/coin_module_test_docs.yaml" + disable_if: + condition: property + property: features + contains_value: lcov |