From d0880e64997a5bee16b447727f800c5ad5139f5f Mon Sep 17 00:00:00 2001 From: Tamas Petz Date: Thu, 25 Jan 2024 11:36:11 +0100 Subject: [PATCH] [scripts] Detailed message for when LLVM_COV is not set Falling back to llvm-cov might produce unexpected results. Users should explicitly state which llvm-cov to use, which is compatible with the toolchain used to produce binaries. --- scripts/ci.sh | 2 +- scripts/generate_coverage_report.sh | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/scripts/ci.sh b/scripts/ci.sh index d88050465..597ef3bcd 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -51,7 +51,7 @@ scripts/prefix_testsuite_names.py build/test-results/sve2/intrinsiccv-api-test.x scripts/prefix_testsuite_names.py build/test-results/sme/intrinsiccv-api-test.xml "SME." # Generate test coverage report -scripts/generate_coverage_report.sh +LLVM_COV=llvm-cov scripts/generate_coverage_report.sh # Set up GitLab Pages (https://docs.gitlab.com/ee/user/project/pages/) mkdir public diff --git a/scripts/generate_coverage_report.sh b/scripts/generate_coverage_report.sh index c69fbaec3..4acd4e1cd 100755 --- a/scripts/generate_coverage_report.sh +++ b/scripts/generate_coverage_report.sh @@ -9,9 +9,20 @@ # Arguments # 1: Path to build folder. Defaults to default build folder. -set -exu +set -eu -: "${LLVM_COV:=llvm-cov}" +# ------------------------------------------------------------------------------ +# Mandatory arguments check +# ------------------------------------------------------------------------------ + +if [[ -z "${LLVM_COV+x}" ]]; then + echo "Required variable 'LLVM_COV' is not set." \ + "Please set it to point to an llvm-cov instance which is compatible" \ + "with the toolchain the binaries were built with." + exit 1 +fi + +set -x # ------------------------------------------------------------------------------ # Automatic configuration -- GitLab