[init] Add new command line arg for use only in functional tests

some of the existing command line args are to be only used in
functional tests. ex: addrmantest, fastprune etc.. make a separate
category -test=<option> for these so that code is cleaner and
user's debug-help output is straightforward.
This commit is contained in:
stratospher
2023-12-15 13:41:30 +05:30
parent c2d04f1319
commit 802e6e128b
3 changed files with 33 additions and 0 deletions

View File

@@ -682,6 +682,17 @@ std::string HelpMessageOpt(const std::string &option, const std::string &message
std::string("\n\n");
}
const std::vector<std::string> TEST_OPTIONS_DOC{
};
bool HasTestOption(const ArgsManager& args, const std::string& test_option)
{
const auto options = args.GetArgs("-test");
return std::any_of(options.begin(), options.end(), [test_option](const auto& option) {
return option == test_option;
});
}
fs::path GetDefaultDataDir()
{
// Windows: C:\Users\Username\AppData\Roaming\Bitcoin