_content/doc/fuzz: document custom settings
For golang/go#48255 Change-Id: I41f6fa5ad6eee14c265bb537fda7e4ca3ef62404 Reviewed-on: https://go-review.googlesource.com/c/website/+/372314 Reviewed-by: Bryan Mills <bcmills@google.com> Trust: DO NOT USE <katiehockman@google.com> Run-TryBot: DO NOT USE <katiehockman@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Родитель
4e7a786f45
Коммит
c471c5cea7
|
@ -70,6 +70,28 @@ Below are suggestions that will help you get the most out of fuzzing.
|
|||
the end of each call, and the behavior of a fuzz target should not depend on
|
||||
global state.
|
||||
|
||||
### Custom settings
|
||||
|
||||
The default go command settings should work for most use cases of fuzzing. So
|
||||
typically, an execution of fuzzing on the command line should look like this:
|
||||
|
||||
```
|
||||
$ go test -fuzz={FuzzTestName}
|
||||
```
|
||||
|
||||
However, the `go` command does provide a few settings when running fuzzing.
|
||||
These are documented in the [`cmd/go` package docs](https://pkg.go.dev/cmd/go).
|
||||
|
||||
To highlight a few:
|
||||
|
||||
- `-fuzztime`: the total time or number of iterations that the fuzz target
|
||||
will be executed before exiting, default indefinitely.
|
||||
- `-fuzzminimizetime`: the time or number of iterations that the fuzz target
|
||||
will be executed during each minimization attempt, default 60sec. You can
|
||||
completely disable minimization by setting `-fuzzminimizetime 0` when fuzzing.
|
||||
- `-parallel`: the number of fuzzing processes running at once, default
|
||||
`$GOMAXPROCS`. Currently, setting -cpu during fuzzing has no effect.
|
||||
|
||||
## Resources
|
||||
|
||||
- **Tutorial**:
|
||||
|
|
Загрузка…
Ссылка в новой задаче