Electroneum
Loading...
Searching...
No Matches
main.cpp File Reference
#include "gtest/gtest.h"
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/program_options.hpp>
#include "p2p/net_node.h"
#include "p2p/net_node.inl"
#include "cryptonote_protocol/cryptonote_protocol_handler.h"
#include "cryptonote_protocol/cryptonote_protocol_handler.inl"
#include "include_base_utils.h"
#include "string_tools.h"
#include "common/command_line.h"
#include "common/util.h"
#include "unit_tests_utils.h"
Include dependency graph for main.cpp:

Go to the source code of this file.

Namespaces

namespace  nodetool
namespace  cryptonote
 Holds cryptonote related classes and helpers.

Functions

int main (int argc, char **argv)

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 55 of file main.cpp.

56{
57 TRY_ENTRY();
58
61 mlog_configure(mlog_get_default_log_path("unit_tests.log"), true);
63
64 ::testing::InitGoogleTest(&argc, argv);
65
66 po::options_description desc_options("Command line options");
67 const command_line::arg_descriptor<std::string> arg_data_dir = { "data-dir", "Data files directory", DEFAULT_DATA_DIR };
68 command_line::add_arg(desc_options, arg_data_dir);
69
70 po::variables_map vm;
71 bool r = command_line::handle_error_helper(desc_options, [&]()
72 {
73 po::store(po::parse_command_line(argc, argv, desc_options), vm);
74 po::notify(vm);
75 return true;
76 });
77 if (! r)
78 return 1;
79
81
82 CATCH_ENTRY_L0("main", 1);
83
84 return RUN_ALL_TESTS();
85}
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
Definition gtest.h:2232
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)
Definition mlog.cpp:148
std::string mlog_get_default_log_path(const char *default_filename)
Definition mlog.cpp:72
#define CATCH_ENTRY_L0(lacation, return_val)
#define TRY_ENTRY()
void add_arg(boost::program_options::options_description &description, const arg_descriptor< T, required, dependent, NUM_DEPS > &arg, bool unique=true)
bool handle_error_helper(const boost::program_options::options_description &desc, F parser)
T get_arg(const boost::program_options::variables_map &vm, const arg_descriptor< T, false, true > &arg)
const command_line::arg_descriptor< std::string, false, true, 2 > arg_data_dir
bool get_set_enable_assert(bool set=false, bool v=false)
bool set_module_name_and_folder(const std::string &path_to_process_)
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
bool on_startup()
Definition util.cpp:778
boost::filesystem::path data_dir
Definition main.cpp:50
Here is the call graph for this function: