Skip to content

Commit

Permalink
use correct llvm path for coverage test
Browse files Browse the repository at this point in the history
  • Loading branch information
yihau committed Aug 15, 2024
1 parent 351dfb9 commit cc71b2a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ci/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ RUN \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs/ | sh -s -- --no-modify-path --profile minimal --default-toolchain $RUST_VERSION -y && \
rustup component add rustfmt && \
rustup component add clippy && \
rustup component add llvm-tools-preview && \
rustup install $RUST_NIGHTLY_VERSION && \
rustup component add clippy --toolchain=$RUST_NIGHTLY_VERSION && \
rustup component add rustfmt --toolchain=$RUST_NIGHTLY_VERSION && \
rustup component add miri --toolchain=$RUST_NIGHTLY_VERSION && \
rustup component add llvm-tools-preview --toolchain=$RUST_NIGHTLY_VERSION && \
rustup target add wasm32-unknown-unknown && \
cargo install cargo-audit && \
cargo install cargo-hack && \
Expand Down
9 changes: 9 additions & 0 deletions scripts/coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ fi
# shellcheck source=ci/rust-version.sh
source "$here/../ci/rust-version.sh" nightly

# Check llvm path
llvm_profdata="$(find "$(rustc +"$rust_nightly" --print sysroot)" -name llvm-profdata)"
if [ -z "$llvm_profdata" ]; then
echo "Error: couldn't find llvm-profdata. Try installing the llvm-tools component with \`rustup component add llvm-tools-preview --toolchain=$rust_nightly\`"
exit 1
fi
llvm_path="$(dirname "$llvm_profdata")"

# get commit hash. it will be used to name output folder
if [ -z "$COMMIT_HASH" ]; then
COMMIT_HASH=$(git rev-parse --short=9 HEAD)
Expand Down Expand Up @@ -66,6 +74,7 @@ grcov_common_args=(
--source-dir "$here/.."
--binary-path "$here/../target/cov/debug"
--llvm
--llvm-path "$llvm_path"
--ignore \*.cargo\*
--ignore \*build.rs
--ignore bench-tps\*
Expand Down

0 comments on commit cc71b2a

Please sign in to comment.