Skip to content

Commit 06a7c84

Browse files
committed
[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 <katie@golang.org> Run-TryBot: Katie Hockman <katie@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com>
1 parent 161439f commit 06a7c84

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/internal/fuzz/coverage.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright 2021 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package fuzz
6+
7+
// coverage returns a []byte containing unique 8-bit counters for each edge of
8+
// the instrumented source code. This coverage data will only be generated if
9+
// `-d=libfuzzer` is set at build time. This can be used to understand the code
10+
// coverage of a test execution.
11+
func coverage() []byte { return nil }

0 commit comments

Comments
 (0)