Bitcoin Core
22.99.0
P2P Digital Currency
src
test
main.cpp
Go to the documentation of this file.
1
// Copyright (c) 2011-2020 The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
8
#define BOOST_TEST_MODULE Bitcoin Core Test Suite
9
10
#include <boost/test/unit_test.hpp>
11
12
#include <
test/util/setup_common.h
>
13
14
#include <iostream>
15
17
const
std::function<void(
const
std::string&)>
G_TEST_LOG_FUN
= [](
const
std::string& s) {
18
static
const
bool
should_log{std::any_of(
19
&boost::unit_test::framework::master_test_suite().argv[1],
20
&boost::unit_test::framework::master_test_suite().argv[boost::unit_test::framework::master_test_suite().argc],
21
[](
const
char
* arg) {
22
return
std::string{
"DEBUG_LOG_OUT"
} == arg;
23
})};
24
if
(!should_log)
return
;
25
std::cout << s;
26
};
setup_common.h
G_TEST_LOG_FUN
const std::function< void(const std::string &)> G_TEST_LOG_FUN
Redirect debug log to unit_test.log files.
Definition:
main.cpp:17
Generated on Mon Nov 8 2021 14:20:05 for Bitcoin Core by
1.9.2