mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-12 12:52:35 -03:00
fa488f131f
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
26 lines
1,010 B
C++
26 lines
1,010 B
C++
// Copyright (c) 2011-2020 The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
/**
|
|
* 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
|
|
*/
|
|
#define BOOST_TEST_MODULE Bitcoin Core Test Suite
|
|
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
#include <test/util/setup_common.h>
|
|
|
|
#include <iostream>
|
|
|
|
/** Redirect debug log to unit_test.log files */
|
|
const std::function<void(const std::string&)> G_TEST_LOG_FUN = [](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;
|
|
};
|