49#ifndef MICRO_TEST_PLUS_TEST_REPORTER_INLINES_H_
50#define MICRO_TEST_PLUS_TEST_REPORTER_INLINES_H_
64#pragma GCC diagnostic push
65#pragma GCC diagnostic ignored "-Waggregate-return"
67#pragma clang diagnostic ignored "-Wc++98-compat"
68#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
95 snprintf (buff,
sizeof (buff),
"%p",
reinterpret_cast<void*
> (v));
137 out_.append (std::to_string (
static_cast<long long> (v.
get ())));
163 for (
const auto& arg : t)
165 *
this << (first ?
"" :
", ") << arg;
183 template <
class Lhs_T,
class Rhs_T>
187 return (*
this <<
color (op) << op.
lhs () <<
" == " << op.
rhs ()
203 template <
class Lhs_T,
class Rhs_T>
207 return (*
this <<
color (op) << op.
lhs () <<
" != " << op.
rhs ()
223 template <
class Lhs_T,
class Rhs_T>
227 return (*
this <<
color (op) << op.
lhs () <<
" > " << op.
rhs ()
244 template <
class Lhs_T,
class Rhs_T>
248 return (*
this <<
color (op) << op.
lhs () <<
" >= " << op.
rhs ()
263 template <
class Lhs_T,
class Rhs_T>
267 return (*
this <<
color (op) << op.
lhs () <<
" < " << op.
rhs ()
284 template <
class Lhs_T,
class Rhs_T>
288 return (*
this <<
color (op) << op.
lhs () <<
" <= " << op.
rhs ()
304 template <
class Lhs_T,
class Rhs_T>
308 return (*
this <<
'(' << op.
lhs () <<
color (op) <<
" and " <<
colors_.none
309 << op.
rhs () <<
')');
324 template <
class Lhs_T,
class Rhs_T>
328 return (*
this <<
'(' << op.
lhs () <<
color (op) <<
" or " <<
colors_.none
329 << op.
rhs () <<
')');
347#if defined(__cpp_exceptions)
360 template <
class Expr_T,
class Exception_T>
364 return (*
this <<
color (op) <<
"throws<"
379 template <
class Expr_T>
383 return (*
this <<
color (op) <<
"throws" <<
colors_.none);
396 template <
class Expr_T>
400 return (*
this <<
color (op) <<
"nothrow" <<
colors_.none);
417 template <
class Expr_T>
423 if (message.empty ())
441 template <
class Expr_T>
450 *
this <<
", " << expr;
460#pragma GCC diagnostic pop
Local implementation of source location information for diagnostics.
Reporter to display test results, including operand values and types for failures.
colors colors_
ANSI colour codes for output formatting.
std::string out_
Internal output buffer for accumulating report content.
test_reporter()=default
Default constructor for the test_reporter class.
void output_pass_suffix_(void)
Outputs the suffix for a passing condition.
void pass(Expr_T &expr, std::string &message)
Report a passed condition.
void output_fail_suffix_(bool abort)
Outputs the suffix for a failing condition.
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)
Output operator for std::string_view.
void output_fail_prefix_(std::string &message, const reflection::source_location &location)
Outputs the prefix for a failing condition.
auto color(const bool cond)
Selects the appropriate colour code based on a condition.
void output_pass_prefix_(std::string &message)
Outputs the prefix for a passing condition.
constexpr auto get(const T &t)
Generic getter function template for value retrieval.
constexpr auto type_name(void) -> std::string_view
Extract the type name from the __PRETTY_FUNCTION__ macro.
static constexpr auto has_npos_v
Variable template to determine if a type provides a static npos member.
typename requires_< Cond >::type requires_t
Alias template for extracting the type member from requires_.
constexpr auto is_op_v
Variable template to determine if a type derives from op.
Primary namespace for the µTest++ testing framework.
Logical AND comparator struct template.
constexpr auto rhs(void) const
Retrieves the right-hand operand.
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Equality comparator struct template.
constexpr auto rhs(void) const
Retrieves the right-hand operand.
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Greater than or equal comparator struct template.
constexpr auto rhs(void) const
Retrieves the right-hand operand.
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Greater than comparator struct template.
constexpr auto lhs(void) const
Retrieves the left-hand operand.
constexpr auto rhs(void) const
Retrieves the right-hand operand.
Less than or equal comparator struct template.
constexpr auto rhs(void) const
Retrieves the right-hand operand.
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Less than comparator struct template.
constexpr auto lhs(void) const
Retrieves the left-hand operand.
constexpr auto rhs(void) const
Retrieves the right-hand operand.
Non-equality comparator struct template.
constexpr auto rhs(void) const
Retrieves the right-hand operand.
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Logical NOT comparator struct template.
constexpr auto value() const
Retrieves the value of the operand.
Operator struct template to check if an expression does not throw any exception.
Logical OR comparator struct template.
constexpr auto rhs(void) const
Retrieves the right-hand operand.
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Operator struct template to check if an expression throws a specific exception.
Struct template representing a genuine integral value.
constexpr decltype(auto) get() const
Getter for the encapsulated value.