Skip to content

Commit

Permalink
ensure correct toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex6323 committed Nov 4, 2024
1 parent 19ad03f commit 40d45e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/cargo_llvm_cov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ jobs:

- name: Generate code coverage report (nextest.info)
run: |
rustup component add llvm-tools --toolchain stable
LLVM_PROFDATA="$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata"
TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}')
rustup component add llvm-tools --toolchain "$TOOLCHAIN"
LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata"
if [[ -x "$LLVM_PROFDATA" ]]; then
$LLVM_PROFDATA --version
else
Expand All @@ -84,15 +85,6 @@ jobs:
exit 1
fi
- name: Upload .profraw dir (temp)
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4
if: always()
with:
name: llvm-cov-target
path: ./target/llvm-cov-target
if-no-files-found: error
retention-days: 1

- name: Generate code coverage report (simtest.info)
run: |
git clean -fd
Expand Down
6 changes: 3 additions & 3 deletions scripts/simtest/simtest-cov.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ git apply ./scripts/simtest/config-patch
root_dir=$(git rev-parse --show-toplevel)
export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics"

# MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --branch --lcov --output-path simtest.info \
# nextest -vv --cargo-profile simulator
TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}')
LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata"

MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv --cargo-profile simulator

find target/llvm-cov-target -name '*.profraw' | while read file; do
if ! "$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" show "$file" > /dev/null 2>&1; then
if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then
echo "Removing corrupted file: $file"
rm "$file"
fi
Expand Down

0 comments on commit 40d45e5

Please sign in to comment.