fix: repair oss-fuzz coverage command

This commit is contained in:
bigbear 2025-11-27 14:28:37 +01:00 committed by GitHub
parent aa1a8dacae
commit 89b4c8e3dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,10 +22,10 @@ function coverbuild {
path=$1 path=$1
function=$2 function=$2
fuzzer=$3 fuzzer=$3
tags="" coverage_package=$coverpkg
if [[ $# -eq 4 ]]; then if [[ $# -eq 4 ]]; then
tags="-tags $4" coverage_package=$4
fi fi
cd $path cd $path
fuzzed_package=`pwd | rev | cut -d'/' -f 1 | rev` fuzzed_package=`pwd | rev | cut -d'/' -f 1 | rev`
@ -38,7 +38,7 @@ cat << DOG > $OUT/$fuzzer
#/bin/sh #/bin/sh
cd $OUT/$path cd $OUT/$path
go test -run Test${function}Corpus -v $tags -coverprofile \$1 -coverpkg $coverpkg go test -run Test${function}Corpus -v -coverprofile \$1 -coverpkg $coverage_package
DOG DOG
@ -64,7 +64,7 @@ function compile_fuzzer() {
go get github.com/holiman/gofuzz-shim/testing go get github.com/holiman/gofuzz-shim/testing
if [[ $SANITIZER == *coverage* ]]; then if [[ $SANITIZER == *coverage* ]]; then
coverbuild $path $function $fuzzer $coverpkg coverbuild $path $function $fuzzer
else else
gofuzz-shim --func $function --package $package -f $file -o $fuzzer.a gofuzz-shim --func $function --package $package -f $file -o $fuzzer.a
$CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer.a -o $OUT/$fuzzer $CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer.a -o $OUT/$fuzzer