micro-test-plus 3.2.0
µTest++, a lightweight testing framework for embedded platforms
|
Reporter to display the test results. For failed tests it prints the actual values of the operands, with their types. More...
#include <micro-os-plus/micro-test-plus.h>
Public Member Functions | |
test_reporter ()=default | |
void | begin_test_case (const char *name) |
void | begin_test_suite (const char *name) |
auto | color (const bool cond) |
void | end_test_case (const char *name) |
void | end_test_suite (test_suite_base &suite) |
void | endline (void) |
template<class Expr_T > | |
void | fail (Expr_T &expr, bool abort, std::string &message, const reflection::source_location &location) |
Report a failed condition. | |
void | flush (void) |
Flush the current buffered content. | |
test_reporter & | operator<< (bool v) |
test_reporter & | operator<< (char *s) |
test_reporter & | operator<< (char c) |
test_reporter & | operator<< (const char *s) |
template<class Lhs_T , class Rhs_T > | |
test_reporter & | operator<< (const detail::and_< Lhs_T, Rhs_T > &op) |
Output operator to display and() expressions. | |
template<class Lhs_T , class Rhs_T > | |
test_reporter & | operator<< (const detail::eq_< Lhs_T, Rhs_T > &op) |
Output operator to display eq() expressions. | |
template<class Lhs_T , class Rhs_T > | |
test_reporter & | operator<< (const detail::ge_< Lhs_T, Rhs_T > &op) |
Output operator to display ge() expressions. | |
template<class Lhs_T , class Rhs_T > | |
test_reporter & | operator<< (const detail::gt_< Lhs_T, Rhs_T > &op) |
Output operator to display gt() expressions. | |
template<class Lhs_T , class Rhs_T > | |
test_reporter & | operator<< (const detail::le_< Rhs_T, Lhs_T > &op) |
Output operator to display le() expressions. | |
template<class Lhs_T , class Rhs_T > | |
test_reporter & | operator<< (const detail::lt_< Rhs_T, Lhs_T > &op) |
Output operator to display lt() expressions. | |
template<class Lhs_T , class Rhs_T > | |
test_reporter & | operator<< (const detail::ne_< Lhs_T, Rhs_T > &op) |
Output operator to display ne() expressions. | |
template<class T > | |
test_reporter & | operator<< (const detail::not_< T > &op) |
Output operator to display not() expressions. | |
template<class Expr_T > | |
test_reporter & | operator<< (const detail::nothrow_< Expr_T > &op) |
template<class Lhs_T , class Rhs_T > | |
test_reporter & | operator<< (const detail::or_< Lhs_T, Rhs_T > &op) |
Output operator to display or() expressions. | |
template<class Expr_T , class Exception_T > | |
test_reporter & | operator<< (const detail::throws_< Expr_T, Exception_T > &op) |
template<class Expr_T > | |
test_reporter & | operator<< (const detail::throws_< Expr_T, void > &op) |
template<class T > | |
test_reporter & | operator<< (const T &t) |
Output operator to types with a getter. | |
template<class T > | |
test_reporter & | operator<< (const type_traits::genuine_integral_value< T > &v) |
Output operator to display genuine integers, without the type suffix. | |
test_reporter & | operator<< (double v) |
test_reporter & | operator<< (float v) |
test_reporter & | operator<< (long double v) |
test_reporter & | operator<< (signed char c) |
test_reporter & | operator<< (signed int v) |
test_reporter & | operator<< (signed long long v) |
test_reporter & | operator<< (signed long v) |
test_reporter & | operator<< (signed short c) |
test_reporter & | operator<< (std::nullptr_t) |
test_reporter & | operator<< (std::string_view sv) |
template<class T , type_traits::requires_t< type_traits::is_container_v< T > and not type_traits::has_npos_v< T > > = 0> | |
test_reporter & | operator<< (T &&t) |
Output operator to display containers. Iterate all members. | |
template<typename T > | |
test_reporter & | operator<< (T *v) |
Output operator to display any pointer. | |
test_reporter & | operator<< (test_reporter &(*func)(test_reporter &)) |
Output operator to display the endl. | |
test_reporter & | operator<< (unsigned char c) |
test_reporter & | operator<< (unsigned int v) |
test_reporter & | operator<< (unsigned long long v) |
test_reporter & | operator<< (unsigned long v) |
test_reporter & | operator<< (unsigned short c) |
void | output (void) |
template<class Expr_T > | |
void | pass (Expr_T &expr, std::string &message) |
Report a passed condition. | |
Public Attributes | |
bool | add_empty_line { true } |
verbosity_t | verbosity {} |
Protected Member Functions | |
void | output_fail_prefix_ (std::string &message, const reflection::source_location &location) |
void | output_fail_suffix_ (bool abort) |
void | output_pass_prefix_ (std::string &message) |
void | output_pass_suffix_ (void) |
Protected Attributes | |
colors | colors_ {} |
bool | is_in_test_case_ = false |
std::string | out_ {} |
Reporter to display the test results. For failed tests it prints the actual values of the operands, with their types.
Definition at line 87 of file test-reporter.h.
|
default |
void micro_os_plus::micro_test_plus::test_reporter::begin_test_case | ( | const char * | name | ) |
Definition at line 280 of file test-reporter.cpp.
void micro_os_plus::micro_test_plus::test_reporter::begin_test_suite | ( | const char * | name | ) |
Definition at line 367 of file test-reporter.cpp.
|
inline |
Definition at line 93 of file test-reporter.h.
void micro_os_plus::micro_test_plus::test_reporter::end_test_case | ( | const char * | name | ) |
Definition at line 300 of file test-reporter.cpp.
void micro_os_plus::micro_test_plus::test_reporter::end_test_suite | ( | test_suite_base & | suite | ) |
Definition at line 387 of file test-reporter.cpp.
void micro_os_plus::micro_test_plus::test_reporter::endline | ( | void | ) |
Definition at line 123 of file test-reporter.cpp.
void micro_os_plus::micro_test_plus::test_reporter::fail | ( | Expr_T & | expr, |
bool | abort, | ||
std::string & | message, | ||
const reflection::source_location & | location ) |
Report a failed condition.
Definition at line 203 of file test-reporter-inlines.h.
void micro_os_plus::micro_test_plus::test_reporter::flush | ( | void | ) |
Flush the current buffered content.
Definition at line 130 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | bool | v | ) |
Definition at line 163 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | char * | s | ) |
Definition at line 156 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | char | c | ) |
Definition at line 142 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const char * | s | ) |
Definition at line 149 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::and_< Lhs_T, Rhs_T > & | op | ) |
Output operator to display and() expressions.
Definition at line 139 of file test-reporter-inlines.h.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::eq_< Lhs_T, Rhs_T > & | op | ) |
Output operator to display eq() expressions.
Definition at line 91 of file test-reporter-inlines.h.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::ge_< Lhs_T, Rhs_T > & | op | ) |
Output operator to display ge() expressions.
Definition at line 115 of file test-reporter-inlines.h.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::gt_< Lhs_T, Rhs_T > & | op | ) |
Output operator to display gt() expressions.
Definition at line 107 of file test-reporter-inlines.h.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::le_< Rhs_T, Lhs_T > & | op | ) |
Output operator to display le() expressions.
Definition at line 131 of file test-reporter-inlines.h.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::lt_< Rhs_T, Lhs_T > & | op | ) |
Output operator to display lt() expressions.
Definition at line 123 of file test-reporter-inlines.h.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::ne_< Lhs_T, Rhs_T > & | op | ) |
Output operator to display ne() expressions.
Definition at line 99 of file test-reporter-inlines.h.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::not_< T > & | op | ) |
Output operator to display not() expressions.
Definition at line 155 of file test-reporter-inlines.h.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::nothrow_< Expr_T > & | op | ) |
Definition at line 179 of file test-reporter-inlines.h.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::or_< Lhs_T, Rhs_T > & | op | ) |
Output operator to display or() expressions.
Definition at line 147 of file test-reporter-inlines.h.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::throws_< Expr_T, Exception_T > & | op | ) |
Definition at line 163 of file test-reporter-inlines.h.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::throws_< Expr_T, void > & | op | ) |
Definition at line 172 of file test-reporter-inlines.h.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const T & | t | ) |
Output operator to types with a getter.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const type_traits::genuine_integral_value< T > & | v | ) |
Output operator to display genuine integers, without the type suffix.
Definition at line 66 of file test-reporter-inlines.h.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | double | v | ) |
Definition at line 264 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | float | v | ) |
Definition at line 256 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | long double | v | ) |
Definition at line 271 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | signed char | c | ) |
Definition at line 177 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | signed int | v | ) |
Definition at line 209 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | signed long long | v | ) |
Definition at line 240 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | signed long | v | ) |
Definition at line 224 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | signed short | c | ) |
Definition at line 193 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | std::nullptr_t | ) |
Definition at line 170 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | std::string_view | sv | ) |
Definition at line 135 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | T && | t | ) |
Output operator to display containers. Iterate all members.
Definition at line 76 of file test-reporter-inlines.h.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | T * | v | ) |
Output operator to display any pointer.
Definition at line 45 of file test-reporter-inlines.h.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | test_reporter &(*)(test_reporter &) | func | ) |
Output operator to display the endl.
Definition at line 114 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | unsigned char | c | ) |
Definition at line 185 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | unsigned int | v | ) |
Definition at line 216 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | unsigned long long | v | ) |
Definition at line 248 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | unsigned long | v | ) |
Definition at line 232 of file test-reporter.cpp.
test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | unsigned short | c | ) |
Definition at line 201 of file test-reporter.cpp.
void micro_os_plus::micro_test_plus::test_reporter::output | ( | void | ) |
Definition at line 424 of file test-reporter.cpp.
|
protected |
Definition at line 71 of file test-reporter.cpp.
|
protected |
Definition at line 102 of file test-reporter.cpp.
|
protected |
Definition at line 47 of file test-reporter.cpp.
|
protected |
Definition at line 63 of file test-reporter.cpp.
void micro_os_plus::micro_test_plus::test_reporter::pass | ( | Expr_T & | expr, |
std::string & | message ) |
Report a passed condition.
Definition at line 188 of file test-reporter-inlines.h.
bool micro_os_plus::micro_test_plus::test_reporter::add_empty_line { true } |
Definition at line 315 of file test-reporter.h.
|
protected |
Definition at line 336 of file test-reporter.h.
|
protected |
Definition at line 339 of file test-reporter.h.
|
protected |
Definition at line 337 of file test-reporter.h.
verbosity_t micro_os_plus::micro_test_plus::test_reporter::verbosity {} |
Definition at line 317 of file test-reporter.h.