#include <common/args.h>
#include <key.h>
#include <node/caches.h>
#include <node/context.h>
#include <primitives/transaction.h>
#include <pubkey.h>
#include <random.h>
#include <stdexcept>
#include <util/chaintype.h>
#include <util/check.h>
#include <util/fs.h>
#include <util/string.h>
#include <util/vector.h>
#include <functional>
#include <type_traits>
#include <vector>
Go to the source code of this file.
◆ SeedRand
Enumerator |
---|
ZEROS | Seed with a compile time constant of zeros.
|
SEED | Call the Seed() helper.
|
Definition at line 58 of file setup_common.h.
◆ getBlock13b8a()
- Returns
- a real block (0000000000013b8ab2cd513b0261a14096412195a72a0c4827d229dcc7e0f7af) with 9 txs.
Definition at line 479 of file setup_common.cpp.
◆ MakeNoLogFileContext()
template<class T = const BasicTestingSetup>
std::unique_ptr<T> MakeNoLogFileContext |
( |
const ChainType |
chain_type = ChainType::REGTEST , |
|
|
const std::vector< const char * > & |
extra_args = {} |
|
) |
| |
Make a test setup that has disk access to the debug.log file disabled.
Can be used in "hot loops", for example fuzzing or benchmarking.
Definition at line 209 of file setup_common.h.
◆ operator<<()
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const uint256 & |
num |
|
) |
| |
◆ Seed()
Seed the given random ctx or use the seed passed in via an environment var.
Definition at line 88 of file setup_common.cpp.
◆ SeedInsecureRand()
◆ CENT
◆ g_insecure_rand_ctx
This global and the helpers that use it are not thread-safe.
If thread-safety is needed, the global could be made thread_local (given that thread_local is supported on all architectures we support) or a per-thread instance could be used in the multi-threaded test.
Definition at line 76 of file setup_common.cpp.
◆ g_mock_deterministic_tests
bool g_mock_deterministic_tests |
|
extern |
Flag to make GetRand in random.h return the same number.
Definition at line 563 of file random.cpp.
◆ G_TEST_COMMAND_LINE_ARGUMENTS
const std::function<std::vector<const char*>)> G_TEST_COMMAND_LINE_ARGUMENTS |
|
extern |
Retrieve the command line arguments.
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 24 of file bench.cpp.
◆ G_TEST_LOG_FUN
const std::function<void(const std::string&)> G_TEST_LOG_FUN |
|
extern |
This is connected to the logger.
Can be used to redirect logs to any other log
This is connected to the logger.
Definition at line 22 of file bench.cpp.