diff --git a/tools/tint-generate-coverage b/tools/tint-generate-coverage index e1bef24723..b7ff48b463 100755 --- a/tools/tint-generate-coverage +++ b/tools/tint-generate-coverage @@ -15,8 +15,6 @@ # See https://clang.llvm.org/docs/SourceBasedCodeCoverage.html -set -e # Fail on any error. - if [ ! -x "$(which llvm-profdata)" ] ; then echo "error: llvm-profdata needs to be on \$PATH to use $0" exit 1 @@ -50,6 +48,9 @@ SUMMARY_FILE="${ROOT_DIR}/coverage.summary" # https://clang.llvm.org/docs/SourceBasedCodeCoverage.html#running-the-instrumented-program LLVM_PROFILE_FILE="${PROFRAW_FILE}" $@ +# Fail on any error after running the target executable +set -e + # Index the coverage data # https://clang.llvm.org/docs/SourceBasedCodeCoverage.html#creating-coverage-reports llvm-profdata merge -sparse "${PROFRAW_FILE}" -o "${PROFDATA_FILE}"