diff options
author | Catena cyber <35799796+catenacyber@users.noreply.github.com> | 2021-03-16 20:19:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-16 12:19:02 -0700 |
commit | 5c174c7e36460405a0094e6e375e8eb81d23dcc3 (patch) | |
tree | 846eac23ac6ff78ad19dea68864f5525d7c9afa2 /infra/base-images/base-runner/coverage | |
parent | dd40bbdac43fc97f0b2550b8062086cc8ffc9942 (diff) | |
download | oss-fuzz-5c174c7e36460405a0094e6e375e8eb81d23dcc3.tar.gz |
Golang coverage: use absolute paths (#5407)
Diffstat (limited to 'infra/base-images/base-runner/coverage')
-rwxr-xr-x | infra/base-images/base-runner/coverage | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/infra/base-images/base-runner/coverage b/infra/base-images/base-runner/coverage index f74345f7a..a86b00dec 100755 --- a/infra/base-images/base-runner/coverage +++ b/infra/base-images/base-runner/coverage @@ -118,6 +118,10 @@ function run_go_fuzz_target { export FUZZ_CORPUS_DIR="/corpus/${target}/" export FUZZ_PROFILE_NAME="$DUMPS_DIR/$target.perf" $OUT/$target -test.coverprofile $DUMPS_DIR/$target.profdata &> $LOGS_DIR/$target.log + # translate from golangish paths to current absolute paths + cat $OUT/$target.gocovpath | while read i; do sed -i $i $DUMPS_DIR/$target.profdata; done + # cf PATH_EQUIVALENCE_ARGS + sed -i 's=/='$OUT'/=' $DUMPS_DIR/$target.profdata $SYSGOPATH/bin/gocovsum $DUMPS_DIR/$target.profdata > $FUZZER_STATS_DIR/$target.json } @@ -162,7 +166,7 @@ wait if [[ $FUZZING_LANGUAGE == "go" ]]; then $SYSGOPATH/bin/gocovmerge $DUMPS_DIR/*.profdata > fuzz.cov - GO111MODULE=off go tool cover -html=fuzz.cov -o $REPORT_ROOT_DIR/index.html + go tool cover -html=fuzz.cov -o $REPORT_ROOT_DIR/index.html $SYSGOPATH/bin/gocovsum fuzz.cov > $SUMMARY_FILE cp $REPORT_ROOT_DIR/index.html $REPORT_PLATFORM_DIR/index.html $SYSGOPATH/bin/pprof-merge $DUMPS_DIR/*.perf.cpu.prof |