102 po::options_description desc_options(
"Allowed options");
110 po::variables_map vm;
122 std::cout << desc_options << std::endl;
129 size_t tests_count = 0;
130 std::vector<std::string> failed_tests;
139 const uint8_t initial_hf = (
uint8_t)get_env_long(
"TEST_MIN_HF", 11);
142 MINFO(
"Testing hardforks [" << (
int)initial_hf <<
", " << (
int)max_hf <<
"]");
146 std::shared_ptr<mock_daemon>
daemon =
nullptr;
149 trezor_base.
setup_args(trezor_path, heavy_tests);
153 po::variables_map vm_core;
154 po::options_description desc_params_core(
"Core");
160 for(
uint8_t hf=initial_hf; hf <= max_hf + 1; ++hf)
162 if (hf > initial_hf || hf > max_hf)
164 daemon->stop_and_deinit();
166 trezor_base.
daemon(
nullptr);
173 MDEBUG(
"Transaction tests for HF " << (
int)hf);
177 daemon = std::make_shared<mock_daemon>(
core, vm_core);
180 daemon->try_init_and_run();
184 if (hf == initial_hf)
212 MLOG(level,
"\nREPORT:");
213 MLOG(level,
" Test run: " << tests_count);
214 MLOG(level,
" Failures: " << failed_tests.size());
215 if (!failed_tests.empty())
217 MLOG(level,
"FAILED TESTS:");
218 BOOST_FOREACH(
auto test_name, failed_tests)
220 MLOG(level,
" " << test_name);
224 return failed_tests.empty() ? 0 : 1;
const char *const ELECTRONEUM_RELEASE_NAME
#define CHECK_AND_ASSERT_THROW_MES(expr, message)
bool deinit()
performs safe shutdown steps for core and core components
Information representing errors in application but application will keep running. ...
static void init_options(boost::program_options::options_description &option_spec)
std::string mlog_get_default_log_path(const char *default_filename)
void mlog_configure(const std::string &filename_base, bool console, const std::size_t max_log_file_size=MAX_LOG_FILE_SIZE, const std::size_t max_log_files=MAX_LOG_FILES)
bool register_device(const std::string &device_name, device *hw_device)
const arg_descriptor< bool > arg_help
virtual void setup_args(const std::string &trezor_path, bool heavy_tests=false)
Level
Represents enumeration for severity level used to determine level of logging.
const char *const ELECTRONEUM_VERSION_FULL
bool handle_error_helper(const boost::program_options::options_description &desc, F parser)
handles core cryptonote functionality
void add_arg(boost::program_options::options_description &description, const arg_descriptor< T, required, dependent, NUM_DEPS > &arg, bool unique=true)
#define TREZOR_COMMON_TEST_CASE(genclass, CORE, BASE)
Mainly useful to represent current progress of application.
std::shared_ptr< mock_daemon > daemon() const
static void default_options(boost::program_options::variables_map &vm)
T get_arg(const boost::program_options::variables_map &vm, const arg_descriptor< T, false, true > &arg)
boost::program_options::basic_parsed_options< charT > parse_command_line(int argc, const charT *const argv[], const boost::program_options::options_description &desc, bool allow_unregistered=false)
#define TREZOR_SETUP_CHAIN(NAME)
std::string to_string(t_connection_type type)
#define CATCH_ENTRY_L0(lacation, return_val)
void mlog_set_log_level(int level)
virtual void set_hard_fork(uint8_t hf)
cryptonote::network_type nettype() const