|
micro-test-plus 4.1.0
µTest++ Testing Framework
|
TAP (Test Anything Protocol) implementation of reporter. More...
#include <micro-os-plus/micro-test-plus.h>
Public Member Functions | |
| reporter_tap (const reporter_tap &)=delete | |
| Deleted copy constructor to prevent copying. | |
| reporter_tap (reporter_tap &&)=delete | |
| Deleted move constructor to prevent moving. | |
| reporter_tap (std::unique_ptr< std::vector< std::string_view > > argvs) | |
| Constructor for the reporter_tap class. | |
| ~reporter_tap () override | |
| Destructor for the reporter_tap class. | |
| void | begin_session (runner &runner) override |
| Mark the beginning of a test session. | |
| virtual void | begin_subtest (subtest &subtest) override |
| Mark the beginning of a subtest. | |
| virtual void | begin_suite (suite &suite) override |
| Mark the beginning of a test suite. | |
| void | end_session (runner &runner) override |
| Mark the end of a test session. | |
| virtual void | end_subtest (subtest &subtest) override |
| Mark the end of a subtest. | |
| virtual void | end_suite (suite &suite) override |
| Mark the end of a test suite. | |
| void | endline (void) |
| Inserts a line ending into the output buffer. | |
| detail::expression_formatter & | expression () |
| Provides access to the expression formatter for this reporter. | |
| 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. | |
| void | flush (void) |
| Flush the current buffered content. | |
| virtual const char * | get_comment_prefix (void) override |
| Returns the TAP comment prefix string "# ". | |
| reporter & | operator<< (bool v) |
| Output operator for boolean values. | |
| reporter & | operator<< (char c) |
| Output operator for a single character. | |
| reporter & | operator<< (const char *s) |
| Output operator for a constant character string. | |
| reporter_tap & | operator<< (detail::indent_t m) |
| Output operator for the indent_t manipulator. | |
| reporter & | operator<< (reporter &(*func)(reporter &)) |
| Output operator to display the endl. | |
| reporter & | operator<< (std::nullptr_t) |
| Output operator for nullptr. | |
| reporter & | operator<< (std::string_view sv) |
| Output operator for std::string_view. | |
| template<typename T> | |
| reporter & | operator<< (T *v) |
| Output operator to display any pointer. | |
| template<class T> requires std::is_arithmetic_v<T> | |
| reporter & | operator<< (T v) |
| Output operator for arithmetic types, with type suffixes. | |
| reporter_tap & | operator= (const reporter_tap &)=delete |
| Deleted copy assignment operator to prevent copying. | |
| reporter_tap & | operator= (reporter_tap &&)=delete |
| Deleted move assignment operator to prevent moving. | |
| void | pass (std::string &message, const std::string &expression, subtest &subtest) |
| Report a passed condition. | |
| auto | verbosity () const -> micro_test_plus::verbosity |
| Returns the current verbosity level. | |
| void | write_buffer_to_stdout (void) |
| Output the current buffered content. | |
Protected Member Functions | |
| auto | colour_ (const bool cond) const |
| Selects the appropriate colour code based on a condition. | |
| void | output_fail_prefix_ (std::string &message, const bool has_expression, const reflection::source_location &location, subtest &subtest) override |
| Outputs the prefix for a failing condition. | |
| void | output_fail_suffix_ (const reflection::source_location &location, bool abort, subtest &subtest) override |
| Outputs the suffix for a failing condition. | |
| void | output_pass_prefix_ (std::string &message, subtest &subtest) override |
| Outputs the prefix for a passing condition. | |
| void | output_pass_suffix_ (subtest &subtest) override |
| Outputs the suffix for a passing condition. | |
| void | write_buffer_to_file_ (void) |
| void | write_info_ (void) |
| Appends informational (non-result) text to the output buffer. | |
Protected Attributes | |
| bool | add_empty_line_ { true } |
| Controls whether to add an empty line between successful test cases. | |
| std::unique_ptr< std::vector< std::string_view > > | argvs_ {} |
| Owns the command-line arguments passed to the test runner. | |
| std::string | buffer_ {} |
| Output accumulation buffer. | |
| detail::colours | colours_ {} |
| ANSI colour codes for output formatting. | |
| detail::expression_formatter | expression_ { colours_ } |
| Expression formatter for pass and fail reporting. | |
| FILE * | output_file_ { nullptr } |
| Optional output file for redirecting test report output. | |
| const char * | output_file_path_ { nullptr } |
| Optional file path for redirecting test report output. | |
| enum verbosity | verbosity_ = verbosity::normal |
| The verbosity level for test reporting. | |
reporter_tap provides a concrete implementation of the reporter abstract interface that formats test results according to the Test Anything Protocol (TAP). It accumulates output in an internal string buffer and writes it to the standard output stream.
Users who require custom output behaviour (e.g. redirecting to a serial port on bare-metal targets) may derive a new class from reporter and supply an instance via the reporter global pointer before calling initialize().
All members and methods are defined within the micro_os_plus::micro_test_plus namespace, ensuring clear separation from user code and minimising the risk of naming conflicts.
Definition at line 93 of file reporter-tap.h.
| micro_os_plus::micro_test_plus::reporter_tap::reporter_tap | ( | std::unique_ptr< std::vector< std::string_view > > | argvs | ) |
| argvs | Owning pointer to the command-line arguments vector; the reporter takes ownership via move. |
Delegates construction to the reporter base class with the supplied argument vector. If tracing is enabled, the function signature is output for diagnostic purposes.
Definition at line 75 of file reporter-tap.cpp.
References micro_os_plus::micro_test_plus::reporter::reporter().
Referenced by reporter_tap(), reporter_tap(), operator<<(), operator=(), and operator=().
|
delete |
References reporter_tap().
|
delete |
References reporter_tap().
|
override |
No resources are owned directly by reporter_tap; the destructor performs no explicit clean-up. If tracing is enabled, the function signature is output for diagnostic purposes.
Definition at line 91 of file reporter-tap.cpp.
|
overridevirtual |
| runner | Reference to the test runner. |
If verbosity is not silent, emits a blank line to stdout and then calls write_info_() to output build and environment information. The TAP version header "TAP version 14" is then written to both the output file (if open) and stdout. The add_empty_line_ flag is cleared so that the first suite header is not separated by an extra blank line.
Implements micro_os_plus::micro_test_plus::reporter.
Definition at line 129 of file reporter-tap.cpp.
References micro_os_plus::micro_test_plus::reporter::add_empty_line_, micro_os_plus::micro_test_plus::reporter::flush(), micro_os_plus::micro_test_plus::reporter::output_file_, micro_os_plus::micro_test_plus::silent, micro_os_plus::micro_test_plus::reporter::verbosity_, and micro_os_plus::micro_test_plus::reporter::write_info_().
|
overridevirtual |
| subtest | Reference to the subtest. |
Validates that the output buffer is empty at subtest start; if not, the buffer is written to stdout, the stream is flushed, and execution is aborted. A "# Subtest: <name>" comment line (indented according to nesting depth) is written to the output file and, under normal or verbose verbosity, to stdout as well.
Implements micro_os_plus::micro_test_plus::reporter.
Definition at line 464 of file reporter-tap.cpp.
References micro_os_plus::micro_test_plus::reporter::add_empty_line_, micro_os_plus::micro_test_plus::reporter::buffer_, micro_os_plus::micro_test_plus::reporter::flush(), micro_os_plus::micro_test_plus::indent(), micro_os_plus::micro_test_plus::indent_size, micro_os_plus::micro_test_plus::detail::test_node::name(), micro_os_plus::micro_test_plus::subtest::nesting_depth(), micro_os_plus::micro_test_plus::normal, micro_os_plus::micro_test_plus::reporter::output_file_, micro_os_plus::micro_test_plus::verbose, micro_os_plus::micro_test_plus::reporter::verbosity_, and micro_os_plus::micro_test_plus::reporter::write_buffer_to_stdout().
|
overridevirtual |
| suite | Reference to the test suite. |
Emits a "# Subtest: <name>" comment line to mark the start of a TAP subtest block for the suite. The line is written to the output file when one is open. Under normal or verbose verbosity, it is also written to stdout, preceded by a blank line when add_empty_line_ is set.
Implements micro_os_plus::micro_test_plus::reporter.
Definition at line 271 of file reporter-tap.cpp.
References micro_os_plus::micro_test_plus::reporter::add_empty_line_, micro_os_plus::micro_test_plus::reporter::flush(), micro_os_plus::micro_test_plus::detail::test_node::name(), micro_os_plus::micro_test_plus::normal, micro_os_plus::micro_test_plus::reporter::output_file_, micro_os_plus::micro_test_plus::verbose, and micro_os_plus::micro_test_plus::reporter::verbosity_.
|
inlinenodiscardprotectedinherited |
| cond | Boolean value indicating pass (true) or fail (false). |
Returns the ANSI colour code for pass or fail, depending on the boolean condition provided.
Definition at line 117 of file reporter-inlines.h.
References colours_.
Referenced by get_comment_prefix().
|
overridevirtual |
| runner | Reference to the test runner. |
Emits the TAP plan line (1..N, where N is the total number of test suites) followed by a comment line summarising successful checks, failed checks, executed test cases, elapsed time, and suite count. Both lines are written to the output file when one is open. When verbosity is set to quiet, the plan is replaced by 1..0 to produce a valid skipped-test TAP document.
Implements micro_os_plus::micro_test_plus::reporter.
Definition at line 180 of file reporter-tap.cpp.
References micro_os_plus::micro_test_plus::reporter::add_empty_line_, micro_os_plus::micro_test_plus::detail::timestamps::compute_elapsed_time(), micro_os_plus::micro_test_plus::detail::runner_totals::executed_subtests(), micro_os_plus::micro_test_plus::detail::runner_totals::failed_checks(), micro_os_plus::micro_test_plus::reporter::flush(), micro_os_plus::micro_test_plus::detail::timestamps::has_timestamps(), micro_os_plus::micro_test_plus::reporter::output_file_, micro_os_plus::micro_test_plus::quiet, micro_os_plus::micro_test_plus::silent, micro_os_plus::micro_test_plus::detail::runner_totals::successful_checks(), micro_os_plus::micro_test_plus::runner::timings(), micro_os_plus::micro_test_plus::runner::total_suites_count(), micro_os_plus::micro_test_plus::detail::test_node::totals(), and micro_os_plus::micro_test_plus::reporter::verbosity_.
|
overridevirtual |
| subtest | Reference to the subtest. |
Emits the TAP plan line for the subtest's checks followed by an ok/not ok result line that includes the subtest index, name, pass/fail status, and check counts. Any output accumulated in buffer_ is flushed to the output file and, when verbosity is verbose or the subtest failed, to stdout as well. The buffer is cleared on exit.
Implements micro_os_plus::micro_test_plus::reporter.
Definition at line 531 of file reporter-tap.cpp.
References micro_os_plus::micro_test_plus::reporter::add_empty_line_, micro_os_plus::micro_test_plus::reporter::buffer_, micro_os_plus::micro_test_plus::detail::runnable_base::children_subtests_count(), micro_os_plus::micro_test_plus::detail::runner_totals::executed_checks(), micro_os_plus::micro_test_plus::detail::runner_totals::executed_subtests(), micro_os_plus::micro_test_plus::detail::runner_totals::failed_checks(), micro_os_plus::micro_test_plus::reporter::flush(), micro_os_plus::micro_test_plus::indent(), micro_os_plus::micro_test_plus::indent_size, micro_os_plus::micro_test_plus::detail::test_node::name(), micro_os_plus::micro_test_plus::subtest::nesting_depth(), micro_os_plus::micro_test_plus::normal, micro_os_plus::micro_test_plus::reporter::output_file_, micro_os_plus::micro_test_plus::detail::runnable_base::own_index(), micro_os_plus::micro_test_plus::detail::runner_totals::successful_checks(), micro_os_plus::micro_test_plus::detail::test_node::totals(), micro_os_plus::micro_test_plus::verbose, micro_os_plus::micro_test_plus::reporter::verbosity_, micro_os_plus::micro_test_plus::detail::runner_totals::was_successful(), micro_os_plus::micro_test_plus::reporter::write_buffer_to_file_(), and micro_os_plus::micro_test_plus::reporter::write_buffer_to_stdout().
|
overridevirtual |
| suite | Reference to the test suite. |
Emits the TAP plan line for the suite's subtests followed by an ok/not ok result line that includes the suite index, name, pass/fail status, check counts, subtest count, and elapsed time. Any output accumulated in buffer_ is flushed to the output file and, when verbosity is verbose or the suite failed, to stdout as well. The buffer is cleared on exit.
Implements micro_os_plus::micro_test_plus::reporter.
Definition at line 328 of file reporter-tap.cpp.
References micro_os_plus::micro_test_plus::reporter::add_empty_line_, micro_os_plus::micro_test_plus::reporter::buffer_, micro_os_plus::micro_test_plus::detail::runnable_base::children_subtests_count(), micro_os_plus::micro_test_plus::detail::timestamps::compute_elapsed_time(), micro_os_plus::micro_test_plus::detail::runner_totals::executed_checks(), micro_os_plus::micro_test_plus::detail::runner_totals::executed_subtests(), micro_os_plus::micro_test_plus::detail::runner_totals::failed_checks(), micro_os_plus::micro_test_plus::reporter::flush(), micro_os_plus::micro_test_plus::detail::timestamps::has_timestamps(), micro_os_plus::micro_test_plus::indent(), micro_os_plus::micro_test_plus::indent_size, micro_os_plus::micro_test_plus::detail::test_node::name(), micro_os_plus::micro_test_plus::normal, micro_os_plus::micro_test_plus::reporter::output_file_, micro_os_plus::micro_test_plus::detail::runnable_base::own_index(), micro_os_plus::micro_test_plus::detail::runner_totals::successful_checks(), micro_os_plus::micro_test_plus::suite::timings(), micro_os_plus::micro_test_plus::detail::test_node::totals(), micro_os_plus::micro_test_plus::verbose, micro_os_plus::micro_test_plus::reporter::verbosity_, micro_os_plus::micro_test_plus::detail::runner_totals::was_successful(), micro_os_plus::micro_test_plus::reporter::write_buffer_to_file_(), and micro_os_plus::micro_test_plus::reporter::write_buffer_to_stdout().
|
inherited |
This method appends a newline character to the internal output buffer of the reporter and immediately flushes the stream. This ensures that each line of test output is clearly separated and promptly displayed, enhancing the readability and organisation of test results across all test cases and folders.
Definition at line 221 of file reporter.cpp.
References buffer_, and flush().
Referenced by micro_os_plus::micro_test_plus::reporter_human::operator<<().
|
inlineinherited |
Returns a reference to the expression_formatter instance used by the reporter for formatting expressions in test reports. This allows the reporter to delegate the formatting of complex expressions to the expression_formatter, which provides a consistent and extensible way to convert various types of values and expressions into their string representations for output in test reports.
Definition at line 106 of file reporter-inlines.h.
References expression_.
Referenced by micro_os_plus::micro_test_plus::subtest::assume(), micro_os_plus::micro_test_plus::subtest::expect(), fail(), get_comment_prefix(), operator<<(), and pass().
|
inherited |
| abort | Whether to abort execution after failure. |
| message | The message to display. |
| expression | The string representation of the expression. |
| has_expression | Whether the expression is a compound op to display. |
| location | The source location of the failure. |
| subtest | The subtest that owns this check. |
Reports a test failure, formatting the output with source location and, when has_expression is true, the pre-formatted expression string.
Definition at line 463 of file reporter.cpp.
References expression(), output_fail_prefix_(), and output_fail_suffix_().
|
inherited |
This method flushes the output buffer of the reporter by synchronising it with the standard output stream. This guarantees that all pending test output is immediately written and visible, ensuring prompt and reliable reporting of test results across all test cases and folders.
Definition at line 365 of file reporter.cpp.
References output_file_.
Referenced by micro_os_plus::micro_test_plus::reporter_human::begin_session(), micro_os_plus::micro_test_plus::reporter_tap::begin_session(), micro_os_plus::micro_test_plus::reporter_human::begin_subtest(), micro_os_plus::micro_test_plus::reporter_tap::begin_subtest(), micro_os_plus::micro_test_plus::reporter_human::begin_suite(), micro_os_plus::micro_test_plus::reporter_tap::begin_suite(), micro_os_plus::micro_test_plus::reporter_human::end_session(), micro_os_plus::micro_test_plus::reporter_tap::end_session(), micro_os_plus::micro_test_plus::reporter_human::end_subtest(), micro_os_plus::micro_test_plus::reporter_tap::end_subtest(), micro_os_plus::micro_test_plus::reporter_human::end_suite(), micro_os_plus::micro_test_plus::reporter_tap::end_suite(), endline(), micro_os_plus::micro_test_plus::reporter_human::output_fail_suffix_(), micro_os_plus::micro_test_plus::reporter_tap::output_fail_suffix_(), micro_os_plus::micro_test_plus::reporter_human::output_pass_suffix_(), and micro_os_plus::micro_test_plus::reporter_tap::output_pass_suffix_().
|
overridevirtual |
Returns "# ". The TAP reporter prefixes all comment lines, including the informational lines emitted by write_info_(), with the TAP comment marker.
Implements micro_os_plus::micro_test_plus::reporter.
Definition at line 657 of file reporter-tap.cpp.
| reporter & micro_os_plus::micro_test_plus::reporter::operator<< | ( | bool | v | ) |
| v | The boolean value to output. |
| reporter & micro_os_plus::micro_test_plus::reporter::operator<< | ( | char | c | ) |
| c | The character to output. |
This operator overload appends the specified character to the internal output buffer of the reporter. It enables efficient streaming of individual characters into the reporter, supporting precise and flexible formatting of test output across all test cases and folders.
Definition at line 216 of file reporter.cpp.
| reporter & micro_os_plus::micro_test_plus::reporter::operator<< | ( | const char * | s | ) |
| s | The string to output. |
This operator overload appends the contents of the provided C-style string to the internal output buffer of the reporter. It enables efficient streaming of string literals and character arrays into the reporter, supporting clear and flexible formatting of test output across all test cases and folders.
Definition at line 225 of file reporter.cpp.
| reporter_tap & micro_os_plus::micro_test_plus::reporter_tap::operator<< | ( | detail::indent_t | m | ) |
| m | The indentation manipulator produced by indent(n). |
This operator overload appends spaces to the internal output buffer corresponding to m.level four-space indentation levels. It enables structured, readable nesting of suite output across all test cases and folders by allowing *this << indent(n) << "text" chaining.
Definition at line 110 of file reporter-tap.cpp.
References reporter_tap(), micro_os_plus::micro_test_plus::reporter::buffer_, micro_os_plus::micro_test_plus::indent_size, and micro_os_plus::micro_test_plus::detail::indent_t::level.
| func | Function pointer to the stream manipulator. |
This operator overload enables manipulators, such as endl, to be used with the reporter stream in a manner similar to standard C++ streams. When a manipulator function is passed, it is invoked with the current reporter instance, allowing for seamless integration of stream operations and improved readability of test output across all test cases and folders.
Definition at line 274 of file reporter.cpp.
| reporter & micro_os_plus::micro_test_plus::reporter::operator<< | ( | std::nullptr_t | ) |
| reporter & micro_os_plus::micro_test_plus::reporter::operator<< | ( | std::string_view | sv | ) |
| sv | The string view to output. |
This operator overload appends the contents of the provided std::string_view to the internal output buffer of the reporter. It enables seamless streaming of string data into the reporter, supporting clear and efficient formatting of test output across all test cases and folders.
Definition at line 207 of file reporter.cpp.
| reporter & micro_os_plus::micro_test_plus::reporter::operator<< | ( | T * | v | ) |
| T | The type of the pointer. |
| v | The pointer value to output. |
This operator overload enables the reporter to output pointer values in a consistent and readable format.
Null pointers are always rendered as the string "nullptr", regardless of the platform, avoiding platform-specific behaviour such as "(nil)" on Linux/glibc or "0x0" on macOS.
Non-null pointers are formatted as a hexadecimal address using snprintf with the p format specifier. The resulting string is appended to the internal output buffer, allowing pointer values to be included in test reports and diagnostics.
This approach provides clear and unambiguous representation of pointer addresses, which is particularly useful for debugging and verifying pointer-related test cases.
Definition at line 265 of file reporter-inlines.h.
| reporter & micro_os_plus::micro_test_plus::reporter::operator<< | ( | T | v | ) |
| T | The arithmetic type. |
| v | The value to output. |
This template operator overload allows the reporter to output values of any arithmetic type (integral or floating-point) in a consistent and readable format. The value is formatted using the append_number_ helper function, which handles the conversion to a string representation with appropriate type suffixes where applicable (e.g., "f" for float, "l" for long double). This enables numeric values to be included in test reports and diagnostics in a clear and unambiguous manner, supporting the verification of test cases that involve arithmetic expressions and comparisons.
Definition at line 253 of file reporter-inlines.h.
|
delete |
References reporter_tap().
|
delete |
References reporter_tap().
|
overrideprotectedvirtual |
| message | The message to display. |
| has_expression | Whether the failure is associated with an expression. |
| location | The source location of the failure. |
| subtest | The subtest that owns this check. |
This method outputs the prefix for a failing check result, applying the appropriate colour formatting and symbols to clearly indicate failure. If the output occurs within a subtest, additional indentation is applied for readability. The prefix includes a cross symbol (✗), an optional message, and YAML diagnostics preamble. Colour formatting and line structure are arranged to conform to TAP14 diagnostics output.
Implements micro_os_plus::micro_test_plus::reporter.
Definition at line 712 of file reporter-tap.cpp.
References micro_os_plus::micro_test_plus::detail::runnable_base::current_subtest_index(), micro_os_plus::micro_test_plus::endl(), micro_os_plus::micro_test_plus::indent(), and micro_os_plus::micro_test_plus::subtest::nesting_depth().
|
overrideprotectedvirtual |
| location | The source location of the failure. |
| abort | Whether to abort execution after failure. |
| subtest | The subtest that owns this check. |
Completes TAP14 YAML diagnostics for a failing check, optionally appends an "aborted..." marker, emits source filename/line fields, closes the YAML block, and flushes the stream.
Implements micro_os_plus::micro_test_plus::reporter.
Definition at line 744 of file reporter-tap.cpp.
References micro_os_plus::micro_test_plus::endl(), micro_os_plus::micro_test_plus::reflection::source_location::file_name(), micro_os_plus::micro_test_plus::reporter::flush(), micro_os_plus::micro_test_plus::indent(), micro_os_plus::micro_test_plus::reflection::source_location::line(), micro_os_plus::micro_test_plus::subtest::nesting_depth(), and micro_os_plus::micro_test_plus::reflection::short_name().
|
overrideprotectedvirtual |
| message | The message to display. |
| subtest | The subtest that owns this check. |
This method outputs the prefix for a passing check result, applying the appropriate colour formatting and symbols to clearly indicate success. If the output occurs within a subtest, additional indentation is applied for readability. The prefix includes a tick symbol (✓) and, if provided, an associated message. Colour formatting is reset after the prefix to maintain consistent output style across all test cases and folders.
The prefix/suffix methods help shorten the code generated by the template methods.
Implements micro_os_plus::micro_test_plus::reporter.
Definition at line 675 of file reporter-tap.cpp.
References micro_os_plus::micro_test_plus::detail::runnable_base::current_subtest_index(), micro_os_plus::micro_test_plus::indent(), and micro_os_plus::micro_test_plus::subtest::nesting_depth().
|
overrideprotectedvirtual |
| subtest | The subtest that owns this check. |
Completes pass output by appending endl and flushing buffered content to the configured sinks.
The prefix/suffix methods help shorten the code generated by the template methods.
Implements micro_os_plus::micro_test_plus::reporter.
Definition at line 695 of file reporter-tap.cpp.
References micro_os_plus::micro_test_plus::endl(), and micro_os_plus::micro_test_plus::reporter::flush().
|
inherited |
| message | The message to display. |
| expression | The string representation of the expression. |
| subtest | The subtest that owns this check. |
Outputs a pass prefix, followed by either the provided message or, if the message is empty, the evaluated expression string itself. A pass suffix is then appended to complete the output.
Definition at line 444 of file reporter.cpp.
References expression(), output_pass_prefix_(), and output_pass_suffix_().
|
inlineinherited |
Returns the verbosity level stored in verbosity_.
Definition at line 91 of file reporter-inlines.h.
References verbosity(), and verbosity_.
Referenced by get_comment_prefix(), and verbosity().
|
protectedinherited |
Writes the contents of buffer_ to output_file_ using fprintf without appending a newline. If output_file_ is null, the call is a no-op.
Definition at line 250 of file reporter.cpp.
References buffer_, and output_file_.
Referenced by micro_os_plus::micro_test_plus::reporter_human::end_subtest(), micro_os_plus::micro_test_plus::reporter_tap::end_subtest(), micro_os_plus::micro_test_plus::reporter_human::end_suite(), micro_os_plus::micro_test_plus::reporter_tap::end_suite(), and get_comment_prefix().
|
inherited |
This method writes the contents of the internal output buffer to the standard output stream without appending a newline character. After outputting the buffer, it is cleared to prepare for subsequent output. This approach ensures that test results are presented promptly and efficiently, supporting clear and organised reporting across all test cases and folders.
Definition at line 237 of file reporter.cpp.
References buffer_.
Referenced by micro_os_plus::micro_test_plus::reporter_tap::begin_subtest(), micro_os_plus::micro_test_plus::reporter_human::end_subtest(), micro_os_plus::micro_test_plus::reporter_tap::end_subtest(), micro_os_plus::micro_test_plus::reporter_human::end_suite(), and micro_os_plus::micro_test_plus::reporter_tap::end_suite().
|
protectedinherited |
Constructs and emits two informational lines: the first lists the programme name and any command-line arguments; the second identifies the compiler (Clang, GCC, or MSVC) together with the version string, floating-point availability on bare-metal targets, exception support, and any active debug or trace macros. Both lines are written to the output file when one is open, and to stdout unless verbosity is set to silent.
Definition at line 270 of file reporter.cpp.
References argvs_.
Referenced by micro_os_plus::micro_test_plus::reporter_human::begin_session(), micro_os_plus::micro_test_plus::reporter_tap::begin_session(), and get_comment_prefix().
|
protectedinherited |
Used to nicely format the output.
Definition at line 572 of file reporter.h.
Referenced by micro_os_plus::micro_test_plus::reporter_human::begin_session(), micro_os_plus::micro_test_plus::reporter_tap::begin_session(), micro_os_plus::micro_test_plus::reporter_human::begin_subtest(), micro_os_plus::micro_test_plus::reporter_tap::begin_subtest(), micro_os_plus::micro_test_plus::reporter_human::begin_suite(), micro_os_plus::micro_test_plus::reporter_tap::begin_suite(), micro_os_plus::micro_test_plus::reporter_human::end_session(), micro_os_plus::micro_test_plus::reporter_tap::end_session(), micro_os_plus::micro_test_plus::reporter_human::end_subtest(), micro_os_plus::micro_test_plus::reporter_tap::end_subtest(), micro_os_plus::micro_test_plus::reporter_human::end_suite(), and micro_os_plus::micro_test_plus::reporter_tap::end_suite().
|
protectedinherited |
Definition at line 596 of file reporter.h.
Referenced by reporter(), micro_os_plus::micro_test_plus::reporter_human::operator<<(), and write_info_().
|
protectedinherited |
Accumulates all reporter output until it is written to standard output or the output file via write_buffer_to_stdout() or write_buffer_to_file_().
Definition at line 552 of file reporter.h.
Referenced by reporter(), micro_os_plus::micro_test_plus::reporter_human::begin_subtest(), micro_os_plus::micro_test_plus::reporter_tap::begin_subtest(), micro_os_plus::micro_test_plus::reporter_human::end_subtest(), micro_os_plus::micro_test_plus::reporter_tap::end_subtest(), micro_os_plus::micro_test_plus::reporter_human::end_suite(), micro_os_plus::micro_test_plus::reporter_tap::end_suite(), endline(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), micro_os_plus::micro_test_plus::reporter_human::operator<<(), micro_os_plus::micro_test_plus::reporter_tap::operator<<(), write_buffer_to_file_(), and write_buffer_to_stdout().
|
protectedinherited |
Definition at line 542 of file reporter.h.
Referenced by micro_os_plus::micro_test_plus::reporter_human::reporter_human(), colour_(), micro_os_plus::micro_test_plus::reporter_human::end_session(), micro_os_plus::micro_test_plus::reporter_human::end_subtest(), micro_os_plus::micro_test_plus::reporter_human::end_suite(), micro_os_plus::micro_test_plus::reporter_human::output_fail_prefix_(), and micro_os_plus::micro_test_plus::reporter_human::output_pass_prefix_().
|
protectedinherited |
Used in pass() and fail() to format expression values before appending the result to buffer_. Will also be used by detail::deferred_reporter to pre-format expressions at construction time.
Definition at line 563 of file reporter.h.
Referenced by expression().
|
protectedinherited |
When non-null, all output is written to this file instead of standard output. The reporter does not own the file; the caller is responsible for its lifetime.
Definition at line 591 of file reporter.h.
Referenced by reporter(), ~reporter(), micro_os_plus::micro_test_plus::reporter_human::begin_session(), micro_os_plus::micro_test_plus::reporter_tap::begin_session(), micro_os_plus::micro_test_plus::reporter_human::begin_subtest(), micro_os_plus::micro_test_plus::reporter_tap::begin_subtest(), micro_os_plus::micro_test_plus::reporter_human::begin_suite(), micro_os_plus::micro_test_plus::reporter_tap::begin_suite(), micro_os_plus::micro_test_plus::reporter_human::end_session(), micro_os_plus::micro_test_plus::reporter_tap::end_session(), micro_os_plus::micro_test_plus::reporter_human::end_subtest(), micro_os_plus::micro_test_plus::reporter_tap::end_subtest(), micro_os_plus::micro_test_plus::reporter_human::end_suite(), micro_os_plus::micro_test_plus::reporter_tap::end_suite(), flush(), and write_buffer_to_file_().
|
protectedinherited |
When non-null, write_buffer_to_file_() writes accumulated output to this path in addition to (or instead of) standard output.
Definition at line 581 of file reporter.h.
Referenced by reporter(), and ~reporter().
|
protectedinherited |
Definition at line 537 of file reporter.h.
Referenced by reporter(), micro_os_plus::micro_test_plus::reporter_human::begin_session(), micro_os_plus::micro_test_plus::reporter_tap::begin_session(), micro_os_plus::micro_test_plus::reporter_human::begin_subtest(), micro_os_plus::micro_test_plus::reporter_tap::begin_subtest(), micro_os_plus::micro_test_plus::reporter_human::begin_suite(), micro_os_plus::micro_test_plus::reporter_tap::begin_suite(), micro_os_plus::micro_test_plus::reporter_human::end_session(), micro_os_plus::micro_test_plus::reporter_tap::end_session(), micro_os_plus::micro_test_plus::reporter_human::end_subtest(), micro_os_plus::micro_test_plus::reporter_tap::end_subtest(), micro_os_plus::micro_test_plus::reporter_human::end_suite(), micro_os_plus::micro_test_plus::reporter_tap::end_suite(), and verbosity().