diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-07-06 19:10:39 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-07-07 19:33:35 +0100 |
commit | 639ca3b1fa9c153a99f1d4e9bb488bd02d282e46 (patch) | |
tree | fd0d6f844c230bee836af99a4edf5bd9c801e4b5 /tests/core_tests/chaingen_main.cpp | |
parent | Merge pull request #4094 (diff) | |
download | monero-639ca3b1fa9c153a99f1d4e9bb488bd02d282e46.tar.xz |
core_tests: add --filter to select which tests to run
Diffstat (limited to 'tests/core_tests/chaingen_main.cpp')
-rw-r--r-- | tests/core_tests/chaingen_main.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/core_tests/chaingen_main.cpp b/tests/core_tests/chaingen_main.cpp index 6a1992cd1..c31655070 100644 --- a/tests/core_tests/chaingen_main.cpp +++ b/tests/core_tests/chaingen_main.cpp @@ -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); |