From ed1b9f68707c2b2419c5d5eee39d1057df16cc34 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 4 Nov 2024 12:09:21 +0100 Subject: [PATCH] use llvm-profdata tool installed by rustup --- .github/workflows/cargo_llvm_cov.yml | 11 ++++++----- scripts/simtest/simtest-cov.sh | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index 5d213f8cc9f..45445171a5e 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -61,12 +61,12 @@ jobs: set +e 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 ! "$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 echo "Removing corrupted file: $file" rm "$file" fi done - cargo llvm-cov --no-run --lcov --output-path target/llvm-cov/nextest.info + cargo llvm-cov --report --lcov --output-path target/llvm-cov/nextest.info if [ -f "target/llvm-cov/nextest.info" ]; then echo "Nextest coverage created." exit 0 @@ -92,9 +92,10 @@ jobs: - name: Merge reports and prepare for upload run: | apt install -yy lcov - #genhtml -o target/llvm-cov/coverage_report --branch-coverage target/llvm-cov/nextest.info target/llvm-cov/simtest.info - genhtml -o target/llvm-cov/coverage_report target/llvm-cov/nextest.info target/llvm-cov/simtest.info - cd target/llvm-cov && tar -czvf coverage_report.tgz ./coverage_report + cd target/llvm-cov + #genhtml -o coverage_report --branch-coverage nextest.info simtest.info + genhtml -o coverage_report nextest.info simtest.info + tar -czvf coverage_report.tgz ./coverage_report - name: Upload uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index 9f75b08a357..cc8efe31a0b 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -22,10 +22,11 @@ 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 --no-report nextest -vv --cargo-profile simulator find target/llvm-cov-target -name '*.profraw' | while read file; do - if ! llvm-profdata show "$file" > /dev/null 2>&1; then + 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 echo "Removing corrupted file: $file" rm "$file" fi +done cargo llvm-cov --no-run --lcov --output-path target/llvm-cov/simtest.info