Bitcoin Core  22.99.0
P2P Digital Currency
Macros | Variables
main.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <test/util/setup_common.h>
#include <functional>
#include <iostream>
Include dependency graph for main.cpp:

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   Bitcoin Core Test Suite
 See https://www.boost.org/doc/libs/1_71_0/libs/test/doc/html/boost_test/utf_reference/link_references/link_boost_test_module_macro.html. More...
 

Variables

const std::function< void(const std::string &)> G_TEST_LOG_FUN
 Redirect debug log to unit_test.log files. More...
 
const std::function< std::vector< const char * >)> G_TEST_COMMAND_LINE_ARGUMENTS
 Retrieve the command line arguments from boost. More...
 

Macro Definition Documentation

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   Bitcoin Core Test Suite

Variable Documentation

◆ G_TEST_COMMAND_LINE_ARGUMENTS

const std::function<std::vector<const char*>)> G_TEST_COMMAND_LINE_ARGUMENTS
Initial value:
= []() {
std::vector<const char*> args;
for (int i = 1; i < boost::unit_test::framework::master_test_suite().argc; ++i) {
args.push_back(boost::unit_test::framework::master_test_suite().argv[i]);
}
return args;
}

Retrieve the command line arguments from boost.

Retrieve the command line arguments.

Allows usage like: test_bitcoin --run_test="net_tests/cnode_listen_port" -- -checkaddrman=1 -printtoconsole=1 which would return ["-checkaddrman=1", "-printtoconsole=1"].

Definition at line 35 of file main.cpp.

◆ G_TEST_LOG_FUN

const std::function<void(const std::string&)> G_TEST_LOG_FUN
Initial value:
= [](const std::string& s) {
static const bool should_log{std::any_of(
&boost::unit_test::framework::master_test_suite().argv[1],
&boost::unit_test::framework::master_test_suite().argv[boost::unit_test::framework::master_test_suite().argc],
[](const char* arg) {
return std::string{"DEBUG_LOG_OUT"} == arg;
})};
if (!should_log) return;
std::cout << s;
}

Redirect debug log to unit_test.log files.

This is connected to the logger.

Definition at line 18 of file main.cpp.

args
ArgsManager args
Definition: notifications.cpp:36