aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz
diff options
context:
space:
mode:
authorVasil Dimov <vd@FreeBSD.org>2021-10-08 18:11:40 +0200
committerVasil Dimov <vd@FreeBSD.org>2022-01-11 11:53:30 +0100
commit92a0f7e58d4b6323d21f1c45d4c20266c35df030 (patch)
tree1f51f10f2aae10beaaf897c014510f3df10bd396 /src/test/fuzz
parentc561f2f06ed25f08f7776ac41aeb2999ebe79550 (diff)
downloadbitcoin-92a0f7e58d4b6323d21f1c45d4c20266c35df030.tar.xz
test: parse the command line arguments in unit tests
Retrieve the command line arguments from boost and pass them to `BasicTestingSetup` so that we gain extra flexibility of passing any config options on the test command line, e.g.: ``` test_bitcoin -- -printtoconsole=1 -checkaddrman=5 ```
Diffstat (limited to 'src/test/fuzz')
-rw-r--r--src/test/fuzz/fuzz.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/fuzz/fuzz.cpp b/src/test/fuzz/fuzz.cpp
index a33297e0ed..1c994a53cf 100644
--- a/src/test/fuzz/fuzz.cpp
+++ b/src/test/fuzz/fuzz.cpp
@@ -12,6 +12,7 @@
#include <cstdint>
#include <exception>
+#include <functional>
#include <memory>
#include <string>
#include <unistd.h>
@@ -19,6 +20,8 @@
const std::function<void(const std::string&)> G_TEST_LOG_FUN{};
+const std::function<std::vector<const char*>()> G_TEST_COMMAND_LINE_ARGUMENTS{};
+
std::map<std::string_view, std::tuple<TypeTestOneInput, TypeInitialize, TypeHidden>>& FuzzTargets()
{
static std::map<std::string_view, std::tuple<TypeTestOneInput, TypeInitialize, TypeHidden>> g_fuzz_targets;