summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2023-04-25 18:38:02 -0600
committerFederico Mena Quintero <federico@gnome.org>2023-04-25 18:38:40 -0600
commit59d5d832be20c37f301ccf4d0de2e0004d49bd86 (patch)
treed9285b37778239e011bee5bf96f6983b4b8e53b8
parentc35228f66a7c95faae44b3ef9e8248501467531f (diff)
downloadlibrsvg-2.56.tar.gz
ci/build-with-coverage.sh: update for clang 16, same as in the main branchlibrsvg-2.56
From 43051221275a35c5c4f6d6fcaf4f654a03e1e171
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--ci/build-with-coverage.sh17
2 files changed, 13 insertions, 6 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index fcbb5731..0e021c1d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -339,8 +339,6 @@ coverage:
script:
- source ./ci/env.sh
- bash -x ./ci/build-with-coverage.sh
- after_script:
- - source ./ci/env.sh
- bash -x ./ci/gen-coverage.sh
coverage: '/Coverage: \d+\.\d+/'
artifacts:
diff --git a/ci/build-with-coverage.sh b/ci/build-with-coverage.sh
index 134c9fde..9226a695 100644
--- a/ci/build-with-coverage.sh
+++ b/ci/build-with-coverage.sh
@@ -2,7 +2,16 @@
set -eux -o pipefail
-clang_version=$(clang --version | head -n 1 | cut -d' ' -f 3)
+clang_version=$(clang --version | head -n 1 | cut -d' ' -f 3 | cut -d'.' -f 1)
+clang_libraries_path="/usr/lib64/clang/$clang_version/lib/linux"
+clang_profile_lib="clang_rt.profile-x86_64"
+
+if [ ! -d $clang_libraries_path ]
+then
+ echo "Expected clang libraries (for $clang_profile_lib) to be in $clang_libraries_path"
+ echo "but that directory does not exist. Please adjust the build-with-coverage.sh script."
+ exit 1
+fi
# Mixed gcc and Rust/LLVM coverage for the C API tests:
# https://searchfox.org/mozilla-central/source/browser/config/mozconfigs/linux64/code-coverage#15
@@ -10,9 +19,9 @@ export CC="clang"
export CFLAGS="-coverage -ftest-coverage -fprofile-arcs"
# RUSTFLAGS: "-Cinstrument-coverage"
export RUSTDOCFLAGS="-Cinstrument-coverage"
-export LLVM_PROFILE_FILE="coverage-profiles/coverage-%p-%m.profraw"
-export LDFLAGS="--coverage -L/usr/lib64/clang/$clang_version/lib/linux"
-export LIBS="-lclang_rt.profile-x86_64"
+export LLVM_PROFILE_FILE="$(pwd)/coverage-profiles/coverage-%p-%m.profraw"
+export LDFLAGS="--coverage -L$clang_libraries_path"
+export LIBS="-l$clang_profile_lib"
export RUSTC_BOOTSTRAP="1" # hack to make -Zprofile work on the non-nightly compiler
export CARGO_INCREMENTAL="0" # -Zprofile (gcov) doesn't like incremental compilation
export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Clink-dead-code -Coverflow-checks=off"