19#if defined(MICRO_OS_PLUS_INCLUDE_CONFIG_H)
20#include <micro-os-plus/config.h>
27#pragma GCC diagnostic ignored "-Waggregate-return"
29#pragma clang diagnostic ignored "-Wc++98-compat"
30#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
56 if (!message.empty ())
58 *
this << message.c_str ();
81 if (!message.empty ())
83 *
this << message.c_str ();
87#pragma GCC diagnostic push
89#pragma clang diagnostic ignored "-Wsign-conversion"
90#elif defined(__GNUC__)
91#pragma GCC diagnostic ignored "-Wnarrowing"
92#pragma GCC diagnostic ignored "-Wsign-conversion"
98#pragma GCC diagnostic pop
107 *
this <<
" aborted...";
166 out_.append (v ?
"true" :
"false");
173 out_.append (
"nullptr");
180 out_.append (std::to_string (c));
188 out_.append (std::to_string (
static_cast<int> (c)));
196 out_.append (std::to_string (v));
204 out_.append (std::to_string (
static_cast<long> (v)));
212 out_.append (std::to_string (v));
219 out_.append (std::to_string (v));
227 out_.append (std::to_string (v));
235 out_.append (std::to_string (v));
243 out_.append (std::to_string (v));
251 out_.append (std::to_string (v));
259 out_.append (std::to_string (v));
267 out_.append (std::to_string (v));
274 out_.append (std::to_string (v));
310 printf (
" • %s - test case started\n", name);
313 " %s✗%s %s - test case %sFAILED%s (%d %s passed, %d "
331 printf (
" • %s - test case started\n", name);
334 " %s✓%s %s - test case passed (%d %s)\n",
colors_.
pass,
347 " %s✓%s %s - test case passed (%d %s)\n",
colors_.
pass,
381 printf (
"• %s - test suite started\n", name);
403 printf (
"%s✓%s %s - test suite passed (%d %s in %d test %s)\n",
412 printf (
"%s✗%s %s - test suite %sFAILED%s (%d %s passed, %d failed, "
426 printf (
"%s",
out_.c_str ());
Local implementation of the std::source_location.
constexpr auto file_name() const noexcept
constexpr auto line() const noexcept
Reporter to display the test results. For failed tests it prints the actual values of the operands,...
void output_pass_suffix_(void)
void output_fail_suffix_(bool abort)
void flush(void)
Flush the current buffered content.
void end_test_case(const char *name)
void begin_test_case(const char *name)
test_reporter & operator<<(std::string_view sv)
void end_test_suite(test_suite_base &suite)
void begin_test_suite(const char *name)
void output_fail_prefix_(std::string &message, const reflection::source_location &location)
void output_pass_prefix_(std::string &message)
Base class for all test suites.
constexpr const char * name()
Get the suite name.
constexpr int test_cases(void)
Get the number of test cases.
struct micro_os_plus::micro_test_plus::test_suite_base::@0 current_test_case
const char * short_name(const char *name)
test_suite_base * current_test_suite
verbosity
The verbosity levels.
test_reporter & endl(test_reporter &stream)