mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 12:46:44 +00:00
fix: repair oss-fuzz coverage command
This commit is contained in:
parent
aa1a8dacae
commit
89b4c8e3dd
1 changed files with 4 additions and 4 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue