Changeset View
Changeset View
Standalone View
Standalone View
src/test/util/setup_common.h
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | |||||
static constexpr Amount CENT(COIN / 100); | static constexpr Amount CENT(COIN / 100); | ||||
/** | /** | ||||
* Basic testing setup. | * Basic testing setup. | ||||
* This just configures logging, data dir and chain parameters. | * This just configures logging, data dir and chain parameters. | ||||
*/ | */ | ||||
struct BasicTestingSetup { | struct BasicTestingSetup { | ||||
ECCVerifyHandle globalVerifyHandle; | ECCVerifyHandle globalVerifyHandle; | ||||
NodeContext m_node; | |||||
explicit BasicTestingSetup( | explicit BasicTestingSetup( | ||||
const std::string &chainName = CBaseChainParams::MAIN); | const std::string &chainName = CBaseChainParams::MAIN); | ||||
~BasicTestingSetup(); | ~BasicTestingSetup(); | ||||
private: | private: | ||||
const fs::path m_path_root; | const fs::path m_path_root; | ||||
}; | }; | ||||
/** | /** | ||||
* Testing setup that configures a complete environment. | * Testing setup that configures a complete environment. | ||||
* Included are coins database, script check threads setup. | * Included are coins database, script check threads setup. | ||||
*/ | */ | ||||
struct TestingSetup : public BasicTestingSetup { | struct TestingSetup : public BasicTestingSetup { | ||||
NodeContext m_node; | |||||
boost::thread_group threadGroup; | boost::thread_group threadGroup; | ||||
explicit TestingSetup( | explicit TestingSetup( | ||||
const std::string &chainName = CBaseChainParams::MAIN); | const std::string &chainName = CBaseChainParams::MAIN); | ||||
~TestingSetup(); | ~TestingSetup(); | ||||
}; | }; | ||||
/** Identical to TestingSetup, but chain set to regtest */ | /** Identical to TestingSetup, but chain set to regtest */ | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |