48#ifndef MICRO_TEST_PLUS_TEST_REPORTER_H_
49#define MICRO_TEST_PLUS_TEST_REPORTER_H_
68#pragma GCC diagnostic push
69#pragma GCC diagnostic ignored "-Wpadded"
70#pragma GCC diagnostic ignored "-Waggregate-return"
72#pragma clang diagnostic ignored "-Wc++98-compat"
73#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
220 [[nodiscard]]
inline auto
402 template <
typename T>
467 template <
class Lhs_T,
class Rhs_T>
480 template <
class Lhs_T,
class Rhs_T>
493 template <
class Lhs_T,
class Rhs_T>
506 template <
class Lhs_T,
class Rhs_T>
519 template <
class Lhs_T,
class Rhs_T>
532 template <
class Lhs_T,
class Rhs_T>
545 template <
class Lhs_T,
class Rhs_T>
558 template <
class Lhs_T,
class Rhs_T>
574#if defined(__cpp_exceptions)
585 template <
class Expr_T,
class Exception_T>
597 template <
class Expr_T>
609 template <
class Expr_T>
638 template <
class Expr_T>
640 pass (Expr_T& expr, std::string& message);
654 template <
class Expr_T>
656 fail (Expr_T& expr,
bool abort, std::string& message,
835#pragma GCC diagnostic pop
Local implementation of source location information for diagnostics.
Reporter to display test results, including operand values and types for failures.
virtual void output_pass_suffix_(void)=0
Outputs the suffix for a passing condition.
colors colors_
ANSI colour codes for output formatting.
virtual void endline(void)=0
Inserts a line ending into the output buffer.
bool is_in_test_case_
Indicates whether the reporter is currently within a test case.
std::string out_
Internal output buffer for accumulating report content.
virtual void output_fail_suffix_(const reflection::source_location &location, bool abort)=0
Outputs the suffix for a failing condition.
virtual void output_fail_prefix_(std::string &message, const bool hasExpression, const reflection::source_location &location)=0
Outputs the prefix for a failing condition.
virtual void end_test(test_runner &runner)=0
Mark the end of a test.
virtual void end_test_case(const char *name)=0
Mark the end of a test case.
virtual void begin_test(size_t test_suites_count)=0
Mark the beginning of a test.
virtual void output_pass_prefix_(std::string &message)=0
Outputs the prefix for a passing condition.
virtual void begin_test_suite(const char *name)=0
Mark the beginning of a test suite.
virtual void flush(void)=0
Flush the current buffered content.
void pass(Expr_T &expr, std::string &message)
Report a passed condition.
virtual ~test_reporter()
Default constructor for the test_reporter class.
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.
verbosity_t verbosity
The verbosity level for test reporting.
virtual void end_test_suite(test_suite_base &suite)=0
Mark the end of a test suite.
auto color(const bool cond)
Selects the appropriate colour code based on a condition.
virtual void output(void)=0
Output the current buffered content.
bool add_empty_line
Controls whether to add an empty line between successful test cases.
virtual void begin_test_case(const char *name)=0
Mark the beginning of a test case.
The test runner for the µTest++ framework.
Base class for all test suites.
C++ header file with declarations for the µTest++ internals.
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_.
Primary namespace for the µTest++ testing framework.
verbosity verbosity_t
Type alias for the verbosity enumeration used in test reporting.
const colors colors_red_green
test_runner runner
Global instance of test_runner.
verbosity
The verbosity levels for test reporting.
test_reporter & endl(test_reporter &stream)
Output stream manipulator for ending a line in test reports.
Colours used to highlight pass and fail results in test reports.
const char * pass
Green colour.
const char * fail
Red colour.
const char * none
Default colour.
Logical AND comparator struct template.
Equality comparator struct template.
Greater than or equal comparator struct template.
Greater than comparator struct template.
Less than or equal comparator struct template.
Less than comparator struct template.
Non-equality comparator struct template.
Logical NOT comparator struct template.
Operator struct template to check if an expression does not throw any exception.
Logical OR comparator struct template.
Operator struct template to check if an expression throws a specific exception.
Struct template representing a genuine integral value.
C++ header file with declarations for the µTest++ test suite.
C++ header file with declarations for the µTest++ type trait utilities and metaprogramming support.