-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This pull-request updates the handling of the functional testing, so that we can now have a header in front of each test. We can now specify per-test options, and we've used that ability to make newline-handling simpler. The parser for the header/options is now covered by fuzz-testing to ensure there are no obvious issues. This closes #190. We've also fixed linter warnings
- Loading branch information
Showing
32 changed files
with
809 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ test: | |
# | ||
.PHONY: tests | ||
tests: | ||
rm test/*.out | ||
go test ./... | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Fuzz Testing | ||
|
||
Fuzz-testing involves creating random input, and running the program with it, to see what happens. | ||
|
||
The expectation is that most of the random inputs will be invalid, so you'll be able to test your error-handling and see where you failed to consider things appropriately. | ||
|
||
|
||
|
||
## Usage | ||
|
||
Within this directory just run: | ||
|
||
``` | ||
$ go test -fuzztime=300s -parallel=1 -fuzz=FuzzOptionsParser -v | ||
``` | ||
|
||
You'll see output like so, reporting on progress: | ||
|
||
``` | ||
.. | ||
=== RUN FuzzOptionsParser | ||
fuzz: elapsed: 0s, gathering baseline coverage: 0/106 completed | ||
fuzz: elapsed: 2s, gathering baseline coverage: 106/106 completed, now fuzzing with 1 workers | ||
fuzz: elapsed: 3s, execs: 145 (48/sec), new interesting: 0 (total: 106) | ||
fuzz: elapsed: 6s, execs: 359 (71/sec), new interesting: 0 (total: 106) | ||
fuzz: elapsed: 9s, execs: 359 (0/sec), new interesting: 0 (total: 106) | ||
fuzz: elapsed: 12s, execs: 359 (0/sec), new interesting: 0 (total: 106) | ||
fuzz: elapsed: 15s, execs: 359 (0/sec), new interesting: 0 (total: 106) | ||
``` | ||
|
||
If you have a beefier host you can drop the `-parallel=1` flag, to run more jobs in parallel, and if you wish you can drop the `-fuzztime=300s` flag to continue running fuzz-testing indefinitely (or until an issue has been found). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.