summaryrefslogtreecommitdiffstats
path: root/coin
diff options
context:
space:
mode:
authorDimitrios Apostolou <jimis@qt.io>2023-11-06 18:38:57 +0100
committerDimitrios Apostolou <jimis@qt.io>2023-11-08 18:24:17 +0100
commit19aa21b595c7e523b6cc941580e55d8c6fc50a6d (patch)
tree504b4ae2489b92e4f0f6c6d62d832d945ecaf3bc /coin
parent3159b337f01767412f51c649d30a72ac8417989b (diff)
CTest should write a JUnit XML test summary
This feature is to be used when testing Qt in Coin (our continuous integration platform). The command line option --output-junit is supported in CMake 3.21 or greater. However we have one particular configuration that tests with CMake 3.16, so we exclude that one. We have already configured the individual tests to print detailed results in their own XML files, using QTest's functionality. But then, when a qt test process crashes, it leaves behind a half-baked XML file, or no file at all. CTest on the contrary knows nothing about the internals of a Qt test, and only cares about the process exit code. Even if a test crashes, it catches that and reports it as a failure. We enable this functionality here to use in addition to what QTest's XML files provide, in order to collect more complete information on test results. Pick-to: 6.6 6.5 Task-number: QTQAINFRA-5146 Change-Id: I226203f93413689f5767a4d01ea1852b453ebf31 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Toni Saario <toni.saario@qt.io>
Diffstat (limited to 'coin')
-rw-r--r--coin/instructions/cmake_run_ctest_enforce_exit_code.yaml10
1 files changed, 10 insertions, 0 deletions
diff --git a/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml b/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml
index db8c8242be..68bbed6173 100644
--- a/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml
+++ b/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml
@@ -73,6 +73,16 @@ instructions:
condition: property
property: features
contains_value: AbortTestingOnFirstFailure
+
+ # Enable CTest's JUnit XML summary only for recent versions
+ - type: AppendToEnvironmentVariable
+ variableName: CTEST_ARGS
+ variableValue: " --output-junit {{.Env.COIN_CTEST_RESULTSDIR}}{{.Env.CI_PATH_SEP}}test_summary.ctest_junit_xml"
+ enable_if:
+ condition: runtime
+ env_var: CMAKE_MIN_SUPPORTED_BIN_PATH
+ equals_value: null
+
- !include "{{qt/qtbase}}/coin_module_test_android_start_emulator.yaml"
- type: EnvironmentVariable