Skip to content

Commit

Permalink
Fix build.sh not to fail if non-existing coverage is requested
Browse files Browse the repository at this point in the history
  • Loading branch information
mikir committed Apr 8, 2024
1 parent 9b4da12 commit 8d90a02
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions scripts/common_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -903,14 +903,17 @@ compile_cpp_for_target()
return 1
fi

# run coverage target if it is requested and if exists
if [[ (! -z "${GCOVR_BIN}" && "${TARGET}" == *"gcc"*) ||
(! -z "${LLVM_PROFDATA_BIN}" && ! -z "${LLVM_COV_BIN}" && "${TARGET}" == *"clang"*) ]] ; then
"${CMAKE}" --build . --target coverage
local COVERAGE_RESULT=$?
if [ ${COVERAGE_RESULT} -ne 0 ] ; then
stderr_echo "Generating of coverage report failed with return code ${COVERAGE_RESULT}."
popd > /dev/null
return 1
if [[ `cmake --build . -- help | grep coverage` ]] ; then
"${CMAKE}" --build . --target coverage
local COVERAGE_RESULT=$?
if [ ${COVERAGE_RESULT} -ne 0 ] ; then
stderr_echo "Generating of coverage report failed with return code ${COVERAGE_RESULT}."
popd > /dev/null
return 1
fi
fi
fi
fi
Expand Down

0 comments on commit 8d90a02

Please sign in to comment.