Skip to content

Commit

Permalink
re-include simtests
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex6323 committed Nov 13, 2024
1 parent cbd12fe commit 8abecc7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
29 changes: 13 additions & 16 deletions .github/workflows/cargo_llvm_cov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,10 @@ jobs:

- name: Install llvm-tools
run: |
# TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1)
TOOLCHAIN=nightly-x86_64-unknown-linux-gnu
rustup component add llvm-tools --toolchain "$TOOLCHAIN"
LLVM_PROFDATA=$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata
echo "LLVM_PROFDATA=$LLVM_PROFDATA" >> $GITHUB_ENV
if [ -x "$LLVM_PROFDATA" ]; then
$LLVM_PROFDATA --version
else
Expand All @@ -78,22 +76,21 @@ jobs:
fi
done
find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge --failure-mode=warn --sparse --output target/nextest.profdata
find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \
--failure-mode=warn \
--sparse \
--output target/nextest.profdata
[ -f "target/nextest.profdata" ] || exit 1
# - name: Compute code coverage (simtest.profdata)
# run: |
# cargo +nightly llvm-cov clean --profraw-only

# git clean -fd
# set +e
# ./scripts/simtest/simtest-cov.sh
# # For now we accept failing simtest coverage
# # [ -f "target/simtest.profdata" ] || exit 1
# if [ ! -f "target/simtest.profdata" ]; then
# echo "Error: failed to create simtest.profdata."
# fi
# exit 0
- name: Compute code coverage (simtest.profdata)
run: |
cargo +nightly llvm-cov clean --profraw-only
git clean -fd
set +e
./scripts/simtest/simtest-cov.sh
[ -f "target/simtest.profdata" ] || exit 1
- name: Create html report (report.tgz)
run: |
Expand Down
6 changes: 4 additions & 2 deletions scripts/simtest/simtest-cov.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ git apply ./scripts/simtest/config-patch
root_dir=$(git rev-parse --show-toplevel)
export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics"

#TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1)
TOOLCHAIN=nightly-x86_64-unknown-linux-gnu
LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata"

Expand All @@ -34,7 +33,10 @@ find target/llvm-cov-target -name '*.profraw' | while read file; do
fi
done

find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge --failure-mode=warn --sparse --output target/simtest.profdata
find target/llvm-cov-target -name '*.profraw' -print0 | xargs -0 $LLVM_PROFDATA merge \
--failure-mode=warn \
--sparse \
--output target/simtest.profdata

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

0 comments on commit 8abecc7

Please sign in to comment.