summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@qt.io>2024-02-24 17:48:39 +0100
committerRobert Griebl <robert.griebl@qt.io>2024-02-26 14:28:19 +0100
commitf86edf793f236c83f81c47ae31d0769b7139b3b8 (patch)
treeb0158d6f253f57317893013c566b1bb87173c20f
parenta1a47122dd3b0729881ecedb3525f09496e20af5 (diff)
coin: Add special build instruction for a lcov code coverage build
Change-Id: I1b80794524e1600a0be5b751b00e69d63407e46a Reviewed-by: Robert Griebl <robert.griebl@qt.io>
-rw-r--r--coin/instructions/cmake_module_lcov_code_coverage.yaml32
-rw-r--r--coin/module_config.yaml34
2 files changed, 62 insertions, 4 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..a8c63e3c
--- /dev/null
+++ b/coin/instructions/cmake_module_lcov_code_coverage.yaml
@@ -0,0 +1,32 @@
+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: ScheduleUploadTestResults
+ - type: EnvironmentVariable
+ variableName: COIN_CTEST_RESULTSDIR
+ variableValue: "{{.SourceDir}}_standalone_tests/coverage-report"
diff --git a/coin/module_config.yaml b/coin/module_config.yaml
index ddf9ba07..f2aed118 100644
--- a/coin/module_config.yaml
+++ b/coin/module_config.yaml
@@ -27,6 +27,21 @@ instructions:
condition: property
property: features
contains_value: Axivion_qtapplicationmanager
+ # Enable a lcov code-coverage build
+ - type: AppendToEnvironmentVariable
+ variableName: NON_QTBASE_CMAKE_ARGS
+ variableValue: " -DAM_COVERAGE=ON"
+ enable_if:
+ condition: property
+ property: features
+ contains_value: lcov
+ - type: AppendToEnvironmentVariable
+ variableName: COMMON_TEST_CMAKE_ARGS
+ variableValue: " -DAM_COVERAGE=ON"
+ enable_if:
+ condition: property
+ property: features
+ contains_value: lcov
- type: Rename
sourcePath: "{{.SourceDir}}/coin/axivion/ci_config_common.json"
targetPath: "{{.Env.HOME}}/axivion/ci_config_common.json"
@@ -38,7 +53,13 @@ instructions:
- type: Group
instructions:
- !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml"
-
+ - type: Group
+ instructions:
+ - !include "{{qt/qtapplicationmanager}}/cmake_module_lcov_code_coverage.yaml"
+ enable_if:
+ condition: property
+ property: features
+ contains_value: lcov
Test:
- type: EnvironmentVariable
variableName: AM_TIMEOUT_FACTOR
@@ -54,6 +75,11 @@ instructions:
- !include "{{qt/qtbase}}/coin_module_test_template_v3.yaml"
- !include "{{qt/qtbase}}/coin_module_test_docs.yaml"
disable_if:
- condition: property
- property: target.os
- in_values: ["IOS", "Android", "WebAssembly", "QNX"]
+ condition: or
+ conditions:
+ - condition: property
+ property: target.os
+ in_values: ["IOS", "Android", "WebAssembly", "QNX"]
+ - condition: property
+ property: features
+ contains_value: lcov