52{
56
57
60
61 po::options_description desc_options("Allowed options");
70
71 po::variables_map vm;
73 {
74 po::store(po::parse_command_line(argc, argv, desc_options), vm);
75 po::notify(vm);
76 return true;
77 });
78 if (!r)
79 return 1;
80
82 {
83 std::cout << desc_options << std::endl;
84 return 0;
85 }
86
88 boost::smatch match;
89
90 size_t tests_count = 0;
91 std::vector<std::string> failed_tests;
93 bool list_tests = false;
95 {
97 }
99 {
101 }
103 {
110
111
112
137
138
157
158
170
171
172
173
175
178
179
180
182
211
240
256
258 if (!list_tests)
259 {
260 MLOG(level,
"\nREPORT:");
261 MLOG(level,
" Test run: " << tests_count);
262 MLOG(level,
" Failures: " << failed_tests.size());
263 }
264 if (!failed_tests.empty())
265 {
266 MLOG(level,
"FAILED TESTS:");
267 BOOST_FOREACH(auto test_name, failed_tests)
268 {
269 MLOG(level,
" " << test_name);
270 }
271 }
272 }
274 {
276 }
277 else
278 {
279 MERROR(
"Wrong arguments");
280 return 2;
281 }
282
283 return failed_tests.empty() ? 0 : 1;
284
286}
#define GENERATE_AND_PLAY(genclass)
#define CALL_TEST(test_name, function)
#define GENERATE(filename, genclass)
#define PLAY(filename, genclass)
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)
std::string mlog_get_default_log_path(const char *default_filename)
void mlog_set_log_level(int level)
#define CATCH_ENTRY_L0(lacation, return_val)
void add_arg(boost::program_options::options_description &description, const arg_descriptor< T, required, dependent, NUM_DEPS > &arg, bool unique=true)
const arg_descriptor< bool > arg_help
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)
Level
Represents enumeration for severity level used to determine level of logging.
@ Info
Mainly useful to represent current progress of application.
@ Error
Information representing errors in application but application will keep running.