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
```
This commit is contained in:
Vasil Dimov committed 2022-01-11 11:53:30 +01:00
1 parent c561f2f06e
commit 92a0f7e58d
7 files changed
+56 -12

No files matched your search

+3
View File
@@ -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[])
{