Skip to content

Commit

Permalink
Rename sh_script/unit_test_coverge.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
  • Loading branch information
sunceping committed Sep 11, 2023
1 parent df11637 commit ddf9087
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions sh_script/unit_test_coverge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
readonly script_name=${0##*/}

unit_test_folder=(
"src/spdm"
)

export RUSTFLAGS="-Cinstrument-coverage"
export LLVM_PROFILE_FILE="unittest-%p-%m.profraw"

find . -name "*.profraw" | xargs rm -rf

for path in ${unit_test_folder[@]}; do
pushd $path
cargo test
grcov . --binary-path ../../target/debug/ -s . -t html --branch --ignore-not-existing -o unit_test_coverage
rm unittest-*
popd
done

unset RUSTFLAGS
unset LLVM_PROFILE_FILE

0 comments on commit ddf9087

Please sign in to comment.