Skip to content

Commit

Permalink
hopefully fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex6323 committed Nov 4, 2024
1 parent f72dbc2 commit 20c4296
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/cargo_llvm_cov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,18 @@ jobs:

- name: Generate code coverage report (nextest.info)
run: |
cargo llvm-cov clean
# LLVM_PROFDATA="$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata"
LLVM_PROFDATA=$(find "$HOME" -iname "llvm-profdata" -print -quit)
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"
if [[ -x "$LLVM_PROFDATA" ]]; then
$LLVM_PROFDATA --version
else
echo "Error: llvm-profdata not found or not executable at $LLVM_PROFDATA"
exit 1
fi
set +e
IOTA_SKIP_SIMTESTS=1 cargo +nightly llvm-cov --ignore-run-fail --no-report nextest -vv
IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv
find target/llvm-cov-target -name '*.profraw' | while read file; do
if ! $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 All @@ -85,7 +84,6 @@ jobs:
- name: Generate code coverage report (simtest.info)
run: |
git clean -fd
cargo llvm-cov clean
set +e
./scripts/simtest/simtest-cov.sh
if [ -f "target/llvm-cov/simtest.info" ]; then
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,10 +16,10 @@ 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 +nightly llvm-cov --ignore-run-fail --branch --lcov --output-path simtest.info \
# 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

MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo +nightly llvm-cov --ignore-run-fail --no-report nextest -vv --cargo-profile simulator
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
Expand All @@ -28,7 +28,7 @@ find target/llvm-cov-target -name '*.profraw' | while read file; do
fi
done

cargo +nightly llvm-cov report --lcov --output-path target/llvm-cov/simtest.info
cargo llvm-cov report --lcov --output-path target/llvm-cov/simtest.info

# remove the patch
git checkout .cargo/config Cargo.toml Cargo.lock

0 comments on commit 20c4296

Please sign in to comment.