summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAlex Richardson <arichardson.kde@gmail.com>2022-03-20 00:40:22 +0000
committerRalf Habacker <ralf.habacker@freenet.de>2022-05-17 10:48:06 +0000
commitf366b38f318034799336b0fde483b63e99d580ba (patch)
treeb93c953529e94bbf49f40f88729d479e39f7121e /tools
parentf385a747b538da9dd46f5b750a58dada9e9bda3e (diff)
downloaddbus-f366b38f318034799336b0fde483b63e99d580ba.tar.gz
tools/ci-build.sh: Add a ci_cmake_junit_output argument
CMake 3.21 can emit JUnit XML test results which can be visualized by GitLab. This also updates the gitlab CI config file to make use of this feature whenever possible.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/ci-build.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/ci-build.sh b/tools/ci-build.sh
index 38c87fe5..e81e0dd4 100755
--- a/tools/ci-build.sh
+++ b/tools/ci-build.sh
@@ -117,6 +117,11 @@ init_wine() {
# If yes, run tests; if no, just build
: "${ci_test:=yes}"
+# ci_cmake_junit_output:
+# If non-empty, emit JUnit XML output from CTest tests to that file
+# Note: requires CMake 3.21 or newer.
+: "${ci_cmake_junit_output:=}"
+
# ci_test_fatal:
# If yes, test failures break the build; if no, they are reported but ignored
: "${ci_test_fatal:=yes}"
@@ -418,7 +423,12 @@ case "$ci_buildsys" in
# The test coverage for OOM-safety is too verbose to be useful on
# travis-ci.
export DBUS_TEST_MALLOC_FAILURES=0
- [ "$ci_test" = no ] || $cmdwrapper ctest -VV --timeout 180 || maybe_fail_tests
+ ctest_args="-VV --timeout 180"
+ if [ -n "$ci_cmake_junit_output" ]; then
+ ctest_args="--output-junit $ci_cmake_junit_output $ctest_args"
+ fi
+
+ [ "$ci_test" = no ] || $cmdwrapper ctest $ctest_args || maybe_fail_tests
${make} install DESTDIR=$(pwd)/DESTDIR
( cd DESTDIR && find . -ls)
;;