Merge bitcoin/bitcoin#23373: test: Parse command line arguments from unit and fuzz tests, make addrman consistency check ratio easier to change
7f122a4188fuzz: non-addrman fuzz tests: override-able check ratio (Vasil Dimov)3bd83e273dfuzz: addrman fuzz tests: override-able check ratio (Vasil Dimov)46b0fe7829test: non-addrman unit tests: override-able check ratio (Vasil Dimov)81e4d54d3atest: addrman unit tests: override-able check ratio (Vasil Dimov)6dff6214bebench: put addrman check ratio in a variable (Vasil Dimov)6f7c7567c5fuzz: parse the command line arguments in fuzz tests (Vasil Dimov)92a0f7e58dtest: parse the command line arguments in unit tests (Vasil Dimov) Pull request description: 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 https://github.com/bitcoin/bitcoin/pull/20233#issuecomment-889813074 for further motivation for this. ACKs for top commit: mzumsande: re-ACK7f122a4188josibake: reACK https://github.com/bitcoin/bitcoin/pull/23373/commits/7f122a4188af7130be9251611e41136a17c814f1 Tree-SHA512: 3a05e61e4d70a0569bb67594bcce3aad8fdef63cdcc54e2823a3bc9f18679571985004412b6c332a210f67849bab32d8467b4115fbff8f5fac9834982e60dcf3
This commit is contained in:
13 files changed
+170
-55
No files matched your search
@@ -22,6 +22,7 @@
|
||||
#include <QApplication>
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
#include <functional>
|
||||
|
||||
#if defined(QT_STATICPLUGIN)
|
||||
#include <QtPlugin>
|
||||
@@ -43,6 +44,8 @@ using node::NodeContext;
|
||||
|
||||
const std::function<void(const std::string&)> G_TEST_LOG_FUN{};
|
||||
|
||||
const std::function<std::vector<const char*>()> G_TEST_COMMAND_LINE_ARGUMENTS{};
|
||||
|
||||
// This is all you need to run all the tests
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user