diff --git a/driver/configurations/bazel/step-build.cmake b/driver/configurations/bazel/step-build.cmake index 5d8d35b..4b054fa 100644 --- a/driver/configurations/bazel/step-build.cmake +++ b/driver/configurations/bazel/step-build.cmake @@ -140,25 +140,41 @@ endif() if(COVERAGE) set(KCOV_TOOL "${DASHBOARD_SOURCE_DIRECTORY}/tools/dynamic_analysis/kcov_tool") - execute_process(COMMAND "${KCOV_TOOL}" ci_merge) - set(KCOV_MERGED "${DASHBOARD_SOURCE_DIRECTORY}/bazel-kcov/kcov-merged") - execute_process(COMMAND "${CMAKE_COMMAND}" -E copy "${KCOV_MERGED}/cobertura.xml" "${KCOV_MERGED}/coverage.xml") - set(ENV{COBERTURADIR} "${KCOV_MERGED}") - ctest_coverage(RETURN_VALUE DASHBOARD_COVERAGE_RETURN_VALUE - CAPTURE_CMAKE_ERROR DASHBOARD_COVERAGE_CAPTURE_CMAKE_ERROR - QUIET) - if(NOT DASHBOARD_COVERAGE_RETURN_VALUE EQUAL 0 OR DASHBOARD_COVERAGE_CAPTURE_CMAKE_ERROR EQUAL -1) - message(WARNING "*** CTest coverage step was not successful") - endif() - if(DASHBOARD_SUBMIT) - ctest_submit(PARTS Coverage - RETRY_COUNT 4 - RETRY_DELAY 15 - RETURN_VALUE DASHBOARD_SUBMIT_COVERAGE_RETURN_VALUE - CAPTURE_CMAKE_ERROR DASHBOARD_SUBMIT_COVERAGE_CAPTURE_CMAKE_ERROR - QUIET) - if(NOT DASHBOARD_SUBMIT_COVERAGE_RETURN_VALUE EQUAL 0 OR DASHBOARD_SUBMIT_COVERAGE_CAPTURE_CMAKE_ERROR EQUAL -1) - message(WARNING "*** CTest submit coverage part was not successful") + execute_process( + COMMAND "${KCOV_TOOL}" ci_merge + COMMAND_ECHO STDERR + RESULT_VARIABLE KCOV_MERGE_RESULT_VARIABLE + ) + if(NOT KCOV_MERGE_RESULT_VARIABLE EQUAL 0) + append_step_status("COVERAGE" UNSTABLE) + else() + set(KCOV_MERGED "${DASHBOARD_SOURCE_DIRECTORY}/bazel-kcov/kcov-merged") + execute_process( + COMMAND "${CMAKE_COMMAND}" -E copy "${KCOV_MERGED}/cobertura.xml" "${KCOV_MERGED}/coverage.xml" + COMMAND_ECHO STDERR + RESULT_VARIABLE KCOV_COPY_RESULT_VARIABLE) + if(NOT KCOV_COPY_RESULT_VARIABLE EQUAL 0) + append_step_status("COVERAGE" UNSTABLE) + else() + set(ENV{COBERTURADIR} "${KCOV_MERGED}") + ctest_coverage(RETURN_VALUE DASHBOARD_COVERAGE_RETURN_VALUE + CAPTURE_CMAKE_ERROR DASHBOARD_COVERAGE_CAPTURE_CMAKE_ERROR + QUIET) + if(NOT DASHBOARD_COVERAGE_RETURN_VALUE EQUAL 0 OR DASHBOARD_COVERAGE_CAPTURE_CMAKE_ERROR EQUAL -1) + append_step_status("COVERAGE" UNSTABLE) + endif() + + if(DASHBOARD_SUBMIT) + ctest_submit(PARTS Coverage + RETRY_COUNT 4 + RETRY_DELAY 15 + RETURN_VALUE DASHBOARD_SUBMIT_COVERAGE_RETURN_VALUE + CAPTURE_CMAKE_ERROR DASHBOARD_SUBMIT_COVERAGE_CAPTURE_CMAKE_ERROR + QUIET) + if(NOT DASHBOARD_SUBMIT_COVERAGE_RETURN_VALUE EQUAL 0 OR DASHBOARD_SUBMIT_COVERAGE_CAPTURE_CMAKE_ERROR EQUAL -1) + message(WARNING "*** CTest submit coverage part was not successful") + endif() + endif() endif() endif() endif()