48#ifndef MICRO_TEST_PLUS_TEST_REPORTER_H_
49#define MICRO_TEST_PLUS_TEST_REPORTER_H_
72#pragma GCC diagnostic push
73#pragma GCC diagnostic ignored "-Wpadded"
74#pragma GCC diagnostic ignored "-Waggregate-return"
76#pragma clang diagnostic ignored "-Wc++98-compat"
77#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
124 endl (reporter& stream);
194 reporter (std::unique_ptr<std::vector<std::string_view>> argvs);
252 requires std::is_arithmetic_v<T>
264 template <
typename T>
349 fail (
bool abort, std::string& message,
const std::string&
expression,
450 detail::expression_formatter&
462 [[nodiscard]] inline auto
463 colour_ (const
bool cond) const;
596 std::unique_ptr<std::vector<std::string_view>>
argvs_{};
603#pragma GCC diagnostic pop
Local implementation of source location information for diagnostics.
void fail(bool abort, std::string &message, const std::string &expression, bool has_expression, const reflection::source_location &location, subtest &subtest)
Report a failed condition.
reporter(std::unique_ptr< std::vector< std::string_view > > argvs)
Constructor for the reporter class.
std::unique_ptr< std::vector< std::string_view > > argvs_
Owns the command-line arguments passed to the test runner.
virtual void output_pass_suffix_(subtest &subtest)=0
Outputs the suffix for a passing condition.
virtual ~reporter()
Virtual destructor for the reporter class.
void pass(std::string &message, const std::string &expression, subtest &subtest)
Report a passed condition.
FILE * output_file_
Optional output file for redirecting test report output.
auto verbosity() const -> micro_test_plus::verbosity
Returns the current verbosity level.
void write_buffer_to_stdout(void)
Output the current buffered content.
virtual void begin_subtest(subtest &subtest)=0
Mark the beginning of a subtest.
bool add_empty_line_
Controls whether to add an empty line between successful test cases.
virtual void output_fail_prefix_(std::string &message, const bool has_expression, const reflection::source_location &location, subtest &subtest)=0
Outputs the prefix for a failing condition.
detail::expression_formatter expression_
Expression formatter for pass and fail reporting.
std::string buffer_
Output accumulation buffer.
void write_info_(void)
Appends informational (non-result) text to the output buffer.
virtual void begin_suite(suite &suite)=0
Mark the beginning of a test suite.
virtual const char * get_comment_prefix(void)=0
Returns the comment-prefix string used by this reporter format.
virtual void end_suite(suite &suite)=0
Mark the end of a test suite.
virtual void output_pass_prefix_(std::string &message, subtest &subtest)=0
Outputs the prefix for a passing condition.
auto colour_(const bool cond) const
Selects the appropriate colour code based on a condition.
const char * output_file_path_
Optional file path for redirecting test report output.
detail::expression_formatter & expression()
Provides access to the expression formatter for this reporter.
virtual void begin_session(runner &runner)=0
Mark the beginning of a test session.
reporter & operator<<(std::string_view sv)
Output operator for std::string_view.
detail::colours colours_
ANSI colour codes for output formatting.
void write_buffer_to_file_(void)
void flush(void)
Flush the current buffered content.
enum verbosity verbosity_
The verbosity level for test reporting.
virtual void end_subtest(subtest &subtest)=0
Mark the end of a subtest.
void endline(void)
Inserts a line ending into the output buffer.
virtual void output_fail_suffix_(const reflection::source_location &location, bool abort, subtest &subtest)=0
Outputs the suffix for a failing condition.
virtual void end_session(runner &runner)=0
Mark the end of a test session.
The test runner for the µTest++ framework.
A named, runnable test case that lives inside a suite.
A named, runnable test suite registered with the test runner.
C++ header file with declarations for the µTest++ internals.
Internal implementation details for the µTest++ framework.
Reflection utilities for the µTest++ testing framework.
Primary namespace for the µTest++ testing framework.
detail::indent_t indent(size_t level)
Factory function that creates an indent_t manipulator.
verbosity
The verbosity levels for test reporting.
reporter & endl(reporter &stream)
Output stream manipulator for ending a line in test reports.
C++ header file with declarations for the µTest++ reflection utilities.
C++ header file with inline implementations for the µTest++ test reporter.
Parameterised stream manipulator for outputting indentation.
size_t level
Number of four-space indentation levels.
C++ header file with declarations for the µTest++ type trait utilities and metaprogramming support.