aboutsummaryrefslogtreecommitdiff
path: root/src/qt/test
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/qt/test
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/qt/test')
-rw-r--r--src/qt/test/test_main.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp
index 11aa61c7fc..10b7e2ffe7 100644
--- a/src/qt/test/test_main.cpp
+++ b/src/qt/test/test_main.cpp
@@ -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[])
{