From: Katie Hockman Date: Wed, 7 Apr 2021 21:40:39 +0000 (-0400) Subject: [dev.fuzz] internal/fuzz: add stub for coverage X-Git-Tag: go1.18beta1~1282^2~77 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=06a7c848d9e3c2804e6d84aeaf777e76df4e5bea;p=gostls13.git [dev.fuzz] internal/fuzz: add stub for coverage This change only includes a stub for the function which will hook into the runtime to expose coverage instrumentation while we're fuzzing. Previously, we discussed an exported API named FuzzCoverage, but since this is within the internal/fuzz package, simply naming it coverage seems appropriate. Change-Id: Iba3240e53e0c4c434e937aa9bb1711a44fec9975 Reviewed-on: https://go-review.googlesource.com/c/go/+/308191 Trust: Katie Hockman Run-TryBot: Katie Hockman Reviewed-by: Matthew Dempsky Reviewed-by: Jay Conrod --- diff --git a/src/internal/fuzz/coverage.go b/src/internal/fuzz/coverage.go new file mode 100644 index 0000000000..7624b56e0a --- /dev/null +++ b/src/internal/fuzz/coverage.go @@ -0,0 +1,11 @@ +// Copyright 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package fuzz + +// coverage returns a []byte containing unique 8-bit counters for each edge of +// the instrumented source code. This coverage data will only be generated if +// `-d=libfuzzer` is set at build time. This can be used to understand the code +// coverage of a test execution. +func coverage() []byte { return nil }