Previously command line arguments passed to unit and fuzz tests would be ignored by the tests themselves. They would be used by the boost test framework (e.g. --run_test="addrman_tests/*"
) or by the fuzzer (e.g. -runs=1
). However both provide ways to pass down the extra arguments to the test itself. Use that, parse the arguments and make them available to the tests via gArgs
.
This makes the tests more flexible as they can be run with any bitcoind config option specified on the command line.
When creating AddrMan
objects in tests, use -checkaddrman=
(if provided) instead of hardcoding the check ratio in many different places. See #20233 (comment) for further motivation for this.