Skip to content

Commit

Permalink
Fix small issues in paths of fuzz.sh (#15058)
Browse files Browse the repository at this point in the history
  • Loading branch information
zi0Black authored Oct 25, 2024
1 parent bb0a7c2 commit 6630bab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions testsuite/fuzzer/fuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function usage() {
echo " build builds fuzz targets"
echo " build-oss-fuzz builds fuzz targets for oss-fuzz"
echo " coverage generates coverage for a fuzz target"
echo " clean-coverage clean coverage for a fuzz target"
echo " debug debugs a fuzz target with a testcase"
echo " flamegraph generates a flamegraph for a fuzz target with a testcase"
echo " list lists existing fuzz targets"
Expand Down Expand Up @@ -149,13 +150,13 @@ function coverage() {
local coverage_dir="./fuzz/coverage/$fuzz_target/report"
mkdir -p $coverage_dir

if [ ! -d "fuzz/coverage/$fuzz_target" ]; then
if [ ! -d "fuzz/coverage/$fuzz_target/raw" ]; then
cargo_fuzz coverage $fuzz_target $corpus_dir
fi

info "Generating coverage for $fuzz_target"

fuzz_target_bin=$(find ./target -name $fuzz_target -type f -perm /111) #$(find target/*/coverage -name $fuzz_target -type f)
fuzz_target_bin=$(find ./target/*/coverage -name $fuzz_target -type f -perm /111) #$(find target/*/coverage -name $fuzz_target -type f)
echo "Found fuzz target binary: $fuzz_target_bin"
# Generate the coverage report
cargo +nightly cov -- show $fuzz_target_bin \
Expand All @@ -174,7 +175,7 @@ function clean-coverage() {
fi

local fuzz_target="$1"
local target_dir="coverage/$fuzz_target"
local coverage_dir="./fuzz/coverage/$fuzz_target/"

if [ "$fuzz_target" == "all" ]; then
rm -rf coverage
Expand Down

0 comments on commit 6630bab

Please sign in to comment.