mirror of
https://github.com/monero-project/monero.git
synced 2025-08-07 13:22:18 -04:00
core_tests: add --filter to select which tests to run
This commit is contained in:
parent
eed4dba880
commit
639ca3b1fa
5 changed files with 29 additions and 20 deletions
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include "chaingen.h"
|
||||
#include "chaingen_tests_list.h"
|
||||
#include "common/util.h"
|
||||
#include "common/command_line.h"
|
||||
#include "transaction_tests.h"
|
||||
|
||||
|
@ -42,6 +43,7 @@ namespace
|
|||
const command_line::arg_descriptor<bool> arg_play_test_data = {"play_test_data", ""};
|
||||
const command_line::arg_descriptor<bool> arg_generate_and_play_test_data = {"generate_and_play_test_data", ""};
|
||||
const command_line::arg_descriptor<bool> arg_test_transactions = {"test_transactions", ""};
|
||||
const command_line::arg_descriptor<std::string> arg_filter = { "filter", "Regular expression filter for which tests to run" };
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
|
@ -61,6 +63,7 @@ int main(int argc, char* argv[])
|
|||
command_line::add_arg(desc_options, arg_play_test_data);
|
||||
command_line::add_arg(desc_options, arg_generate_and_play_test_data);
|
||||
command_line::add_arg(desc_options, arg_test_transactions);
|
||||
command_line::add_arg(desc_options, arg_filter);
|
||||
|
||||
po::variables_map vm;
|
||||
bool r = command_line::handle_error_helper(desc_options, [&]()
|
||||
|
@ -78,6 +81,9 @@ int main(int argc, char* argv[])
|
|||
return 0;
|
||||
}
|
||||
|
||||
const std::string filter = tools::glob_to_regex(command_line::get_arg(vm, arg_filter));
|
||||
boost::smatch match;
|
||||
|
||||
size_t tests_count = 0;
|
||||
std::vector<std::string> failed_tests;
|
||||
std::string tests_folder = command_line::get_arg(vm, arg_test_data_path);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue