aboutsummaryrefslogtreecommitdiff
path: root/src/test/util/setup_common.cpp
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2024-07-08 15:45:56 +0200
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2024-07-08 16:11:15 +0200
commitfa690c8e532672f7ab53be6f7a0bb3070858745e (patch)
tree2ab49e963649a51ba115fe31bbb9527855e479e7 /src/test/util/setup_common.cpp
parentbd5d1688b4311e21c0e0ff89a3ae02ef7d0543b8 (diff)
test: [refactor] Pass TestOpts
Diffstat (limited to 'src/test/util/setup_common.cpp')
-rw-r--r--src/test/util/setup_common.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp
index 52981bd2dc..fec4ae23e8 100644
--- a/src/test/util/setup_common.cpp
+++ b/src/test/util/setup_common.cpp
@@ -112,7 +112,7 @@ static void ExitFailure(std::string_view str_err)
exit(EXIT_FAILURE);
}
-BasicTestingSetup::BasicTestingSetup(const ChainType chainType, const std::vector<const char*>& extra_args)
+BasicTestingSetup::BasicTestingSetup(const ChainType chainType, TestOpts opts)
: m_args{}
{
m_node.shutdown = &m_interrupt;
@@ -129,7 +129,7 @@ BasicTestingSetup::BasicTestingSetup(const ChainType chainType, const std::vecto
"-debugexclude=libevent",
"-debugexclude=leveldb",
},
- extra_args);
+ opts.extra_args);
if (G_TEST_COMMAND_LINE_ARGUMENTS) {
arguments = Cat(arguments, G_TEST_COMMAND_LINE_ARGUMENTS());
}
@@ -220,8 +220,8 @@ BasicTestingSetup::~BasicTestingSetup()
gArgs.ClearArgs();
}
-ChainTestingSetup::ChainTestingSetup(const ChainType chainType, const std::vector<const char*>& extra_args)
- : BasicTestingSetup(chainType, extra_args)
+ChainTestingSetup::ChainTestingSetup(const ChainType chainType, TestOpts opts)
+ : BasicTestingSetup(chainType, opts)
{
const CChainParams& chainparams = Params();
@@ -304,13 +304,11 @@ void ChainTestingSetup::LoadVerifyActivateChainstate()
TestingSetup::TestingSetup(
const ChainType chainType,
- const std::vector<const char*>& extra_args,
- const bool coins_db_in_memory,
- const bool block_tree_db_in_memory)
- : ChainTestingSetup(chainType, extra_args)
+ TestOpts opts)
+ : ChainTestingSetup(chainType, opts)
{
- m_coins_db_in_memory = coins_db_in_memory;
- m_block_tree_db_in_memory = block_tree_db_in_memory;
+ m_coins_db_in_memory = opts.coins_db_in_memory;
+ m_block_tree_db_in_memory = opts.block_tree_db_in_memory;
// Ideally we'd move all the RPC tests to the functional testing framework
// instead of unit tests, but for now we need these here.
RegisterAllCoreRPCCommands(tableRPC);
@@ -339,11 +337,9 @@ TestingSetup::TestingSetup(
}
TestChain100Setup::TestChain100Setup(
- const ChainType chain_type,
- const std::vector<const char*>& extra_args,
- const bool coins_db_in_memory,
- const bool block_tree_db_in_memory)
- : TestingSetup{ChainType::REGTEST, extra_args, coins_db_in_memory, block_tree_db_in_memory}
+ const ChainType chain_type,
+ TestOpts opts)
+ : TestingSetup{ChainType::REGTEST, opts}
{
SetMockTime(1598887952);
constexpr std::array<unsigned char, 32> vchKey = {