aboutsummaryrefslogtreecommitdiff
path: root/doc/fuzzing.md
diff options
context:
space:
mode:
authorVasil Dimov <vd@FreeBSD.org>2021-10-26 17:26:16 +0200
committerVasil Dimov <vd@FreeBSD.org>2022-01-11 11:53:34 +0100
commit6f7c7567c578b5a41f8e90ce4491e40f7faeaa56 (patch)
treeaf435601c1121d6e7ed122a5af6f2ce20840b80b /doc/fuzzing.md
parent92a0f7e58d4b6323d21f1c45d4c20266c35df030 (diff)
downloadbitcoin-6f7c7567c578b5a41f8e90ce4491e40f7faeaa56.tar.xz
fuzz: parse the command line arguments in fuzz tests
Retrieve the command line arguments from the fuzzer and save them for later retrieval by `BasicTestingSetup` so that we gain extra flexibility of passing any config options on the test command line, e.g.: ``` FUZZ=addrman ./src/test/fuzz/fuzz --checkaddrman=5 ``` A fuzz test should call `MakeNoLogFileContext<>()` in its initialize function in order to invoke the constructor of `BasicTestingSetup`, which sets `gArgs`.
Diffstat (limited to 'doc/fuzzing.md')
-rw-r--r--doc/fuzzing.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/fuzzing.md b/doc/fuzzing.md
index 73d04837f1..9abfbc9213 100644
--- a/doc/fuzzing.md
+++ b/doc/fuzzing.md
@@ -71,6 +71,15 @@ block^@M-^?M-^?M-^?M-^?M-^?nM-^?M-^?
In this case the fuzzer managed to create a `block` message which when passed to `ProcessMessage(...)` increased coverage.
+It is possible to specify `bitcoind` arguments to the `fuzz` executable.
+Depending on the test, they may be ignored or consumed and alter the behavior
+of the test. Just make sure to use double-dash to distinguish them from the
+fuzzer's own arguments:
+
+```sh
+$ FUZZ=address_deserialize_v2 src/test/fuzz/fuzz -runs=1 fuzz_seed_corpus/address_deserialize_v2 --checkaddrman=5 --printtoconsole=1
+```
+
## Fuzzing corpora
The project's collection of seed corpora is found in the [`bitcoin-core/qa-assets`](https://github.com/bitcoin-core/qa-assets) repo.