Line data Source code
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 : 5 : /** 6 : * 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 7 : */ 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 : 16 : /** Redirect debug log to unit_test.log files */ 17 327237 : const std::function<void(const std::string&)> G_TEST_LOG_FUN = [](const std::string& s) { 18 327233 : static const bool should_log{std::any_of( 19 85 : &boost::unit_test::framework::master_test_suite().argv[1], 20 85 : &boost::unit_test::framework::master_test_suite().argv[boost::unit_test::framework::master_test_suite().argc], 21 85 : [](const char* arg) { 22 85 : return std::string{"DEBUG_LOG_OUT"} == arg; 23 : })}; 24 327148 : if (!should_log) return; 25 327148 : std::cout << s; 26 327148 : };