Commit b2a72eb7 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

CI: upload XML report of test results to Gitlab

parent 67e36fb9
Loading
Loading
Loading
Loading
+21 −4
Original line number Diff line number Diff line
@@ -116,9 +116,18 @@ stages:
        expire_in: 7 days
        reports:
            cobertura: coverage.xml
            junit: "builddir/$CI_JOB_NAME/tests-report.xml"
        paths:
            - coverage_html/

# template for registering tests-report.xml as an artifact
.tests_report_template:
    artifacts:
        name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
        expire_in: 7 days
        reports:
            junit: "builddir/$CI_JOB_NAME/tests-report.xml"

# Dummy build job to ensure that a pipeline is created for a merge request, even
# when there were no changes.
dummy build job:
@@ -156,7 +165,9 @@ cuda_tests_Debug:
        BUILD_TESTS: "yes"

cuda_tests_Release:
    extends: .build_template
    extends:
        - .build_template
        - .tests_report_template
    stage: build:cuda
    tags:
        - docker
@@ -183,7 +194,9 @@ cuda_matrix_tests_Debug:
        BUILD_MATRIX_TESTS: "yes"

cuda_matrix_tests_Release:
    extends: .build_template
    extends:
        - .build_template
        - .tests_report_template
    stage: build:cuda
    tags:
        - docker
@@ -264,7 +277,9 @@ default_tests_Debug:
        BUILD_TESTS: "yes"

default_tests_Release:
    extends: .build_template
    extends:
        - .build_template
        - .tests_report_template
    variables:
        <<: *default_cmake_flags
        BUILD_TYPE: Release
@@ -280,7 +295,9 @@ default_matrix_tests_Debug:
        BUILD_MATRIX_TESTS: "yes"

default_matrix_tests_Release:
    extends: .build_template
    extends:
        - .build_template
        - .tests_report_template
    variables:
        <<: *default_cmake_flags
        BUILD_TYPE: Release
+3 −0
Original line number Diff line number Diff line
@@ -160,6 +160,9 @@ link_libraries( stdc++fs )
if( ${BUILD_TESTS} OR ${BUILD_MATRIX_TESTS} )
   enable_testing()

   # let CTest write test results in the JUnit XML format
   set( CMAKE_CTEST_ARGUMENTS ${CMAKE_CTEST_ARGUMENTS} --output-junit "${CMAKE_BINARY_DIR}/tests-report.xml" )

   if( ${WITH_SYSTEM_GTEST} OR ${OFFLINE_BUILD} )
      # find gtest installed in the local system
      find_package(GTest REQUIRED)