17#ifndef MICRO_TEST_PLUS_TEST_REPORTER_INLINES_H_
18#define MICRO_TEST_PLUS_TEST_REPORTER_INLINES_H_
32#pragma GCC diagnostic push
33#pragma GCC diagnostic ignored "-Waggregate-return"
35#pragma clang diagnostic ignored "-Wc++98-compat"
36#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
49 snprintf (buff,
sizeof (buff),
"%p",
reinterpret_cast<void*
> (v));
69 out_.append (std::to_string (
static_cast<long long> (v.
get ())));
81 for (
const auto& arg : t)
83 *
this << (first ?
"" :
", ") << arg;
90 template <
class Lhs_T,
class Rhs_T>
94 return (*
this <<
color (op) << op.
lhs () <<
" == " << op.
rhs ()
98 template <
class Lhs_T,
class Rhs_T>
102 return (*
this <<
color (op) << op.
lhs () <<
" != " << op.
rhs ()
106 template <
class Lhs_T,
class Rhs_T>
110 return (*
this <<
color (op) << op.
lhs () <<
" > " << op.
rhs ()
114 template <
class Lhs_T,
class Rhs_T>
118 return (*
this <<
color (op) << op.
lhs () <<
" >= " << op.
rhs ()
122 template <
class Lhs_T,
class Rhs_T>
126 return (*
this <<
color (op) << op.
lhs () <<
" < " << op.
rhs ()
130 template <
class Lhs_T,
class Rhs_T>
134 return (*
this <<
color (op) << op.
lhs () <<
" <= " << op.
rhs ()
138 template <
class Lhs_T,
class Rhs_T>
143 << op.
rhs () <<
')');
146 template <
class Lhs_T,
class Rhs_T>
151 << op.
rhs () <<
')');
161#if defined(__cpp_exceptions)
162 template <
class Expr_T,
class Exception_T>
166 return (*
this <<
color (op) <<
"throws<"
167 << reflection::type_name<Exception_T> () <<
">"
171 template <
class Expr_T>
178 template <
class Expr_T>
186 template <
class Expr_T>
192 if (message.empty ())
201 template <
class Expr_T>
210 *
this <<
", " << expr;
220#pragma GCC diagnostic pop
Local implementation of the std::source_location.
Reporter to display the test results. For failed tests it prints the actual values of the operands,...
void output_pass_suffix_(void)
void pass(Expr_T &expr, std::string &message)
Report a passed condition.
void output_fail_suffix_(bool abort)
void fail(Expr_T &expr, bool abort, std::string &message, const reflection::source_location &location)
Report a failed condition.
test_reporter & operator<<(std::string_view sv)
void output_fail_prefix_(std::string &message, const reflection::source_location &location)
auto color(const bool cond)
void output_pass_prefix_(std::string &message)
constexpr auto get(const T &t)
Generic getter, calling the getter implementation.
typename requires_< Cond >::type requires_t
static constexpr auto has_value_v
constexpr auto lhs() const
constexpr auto rhs() const
constexpr auto rhs() const
constexpr auto lhs() const
Greater than or equal comparator.
constexpr auto rhs() const
constexpr auto lhs() const
constexpr auto rhs() const
constexpr auto lhs() const
Less than or equal comparator.
constexpr auto lhs() const
constexpr auto rhs() const
constexpr auto rhs() const
constexpr auto lhs() const
constexpr auto lhs() const
constexpr auto rhs() const
constexpr auto value() const
Operator to check if the expression does not throw any exception.
constexpr auto lhs() const
constexpr auto rhs() const
Operator to check if the expression throws a specific exception.
constexpr decltype(auto) get() const