reporter.h File
C++ header file with declarations for the µTest++ test reporter. More...
Included Headers
Namespaces Index
| namespace | micro_os_plus |
|
The primary namespace for the µOS++ framework. More... | |
| namespace | micro_test_plus |
|
Primary namespace for the µTest++ testing framework. More... | |
| namespace | detail |
|
Internal implementation details for the µTest++ framework. More... | |
Classes Index
| struct | indentation |
|
Parameterised stream manipulator for outputting indentation. More... | |
| struct | open_test_case |
|
A test case that has begun and not yet ended. More... | |
| struct | output_route |
|
The destinations of a record. More... | |
| class | reporter |
|
Abstract base class for the reporters that display test results, including operand values for failures. More... | |
Enumerations Index
| enum class | record_kind : uint8_t { ... } |
|
The kinds of records written by the reporters. More... | |
Functions Index
| reporter & | endl (reporter &stream) |
|
Output stream manipulator for ending a line in test reports. More... | |
| indentation | indent (size_t level) |
|
Factory function that creates an indentation manipulator. More... | |
Description
C++ header file with declarations for the µTest++ test reporter.
This header provides the declarations for the test reporting facilities used within the µTest++ framework. It defines the endl and indent() stream manipulators, and the abstract reporter base class, which accumulates output in a buffer, writes it to the console and to an optional output file, and dispatches the pass/fail results and the session, suite, and test case events to the concrete reporters (reporter_human and reporter_tap).
The formatting of the values and the comparison expressions is delegated to detail::expression_formatter.
The verbosity levels, and the other session options, are defined in runner-options.h. The manipulators and the reporter are defined in the micro_os_plus::micro_test_plus::detail namespace, since the reporters are internal to the framework.
This file is included by micro-os-plus/micro-test-plus.h, which is the header that the applications include.
Enumerations
record_kind
| strong |
The kinds of records written by the reporters.
- Enumeration values
The output policy, which decides where each kind of record is written at each verbosity level, is in reporter::route(). The concrete reporters only format the records and ask where they go.
Definition at line 160 of file reporter.h.
Functions
endl()
|
Output stream manipulator for ending a line in test reports.
Calls reporter::end_line(), which appends a line ending to the internal buffer. Unlike std::endl, it does not flush; the buffer is written later, by the concrete reporters.
- Parameters
-
stream Reference to the reporter instance.
- Returns
Reference to the same reporter instance, enabling chaining of output operations.
The endl function calls reporter::end_line(), which appends a newline character to the buffer of the specified reporter.
Definition at line 218 of file reporter.cpp.
References micro_os_plus::micro_test_plus::detail::reporter::end_line and micro_os_plus::micro_test_plus::detail::endl.
Referenced by micro_os_plus::micro_test_plus::detail::endl, micro_os_plus::micro_test_plus::detail::reporter_human::fail_suite, micro_os_plus::micro_test_plus::detail::reporter_tap::fail_suite, micro_os_plus::micro_test_plus::detail::reporter_tap::output_fail_prefix, micro_os_plus::micro_test_plus::detail::reporter_human::output_fail_suffix, micro_os_plus::micro_test_plus::detail::reporter_tap::output_fail_suffix, micro_os_plus::micro_test_plus::detail::reporter_human::output_pass_suffix, micro_os_plus::micro_test_plus::detail::reporter_tap::output_pass_suffix and micro_os_plus::micro_test_plus::detail::reporter_tap::pass_without_text.
indent()
| inline nodiscard |
Factory function that creates an indentation manipulator.
Returns an indentation aggregate initialised with level.
Allows writing reporter << indent(n) instead of constructing the manipulator explicitly.
- Parameters
-
level The number of four-space indentation levels.
- Returns
An indentation value for use with operator<<.
Definition at line 64 of file reporter-inlines.h.
Reference micro_os_plus::micro_test_plus::detail::indent.
Referenced by micro_os_plus::micro_test_plus::detail::reporter_human::begin_test_case, micro_os_plus::micro_test_plus::detail::reporter_tap::begin_test_case, micro_os_plus::micro_test_plus::detail::reporter_human::display_open_heading, micro_os_plus::micro_test_plus::detail::reporter_tap::display_open_heading, micro_os_plus::micro_test_plus::detail::reporter_tap::end_suite, micro_os_plus::micro_test_plus::detail::reporter_human::end_test_case, micro_os_plus::micro_test_plus::detail::reporter_tap::end_test_case, micro_os_plus::micro_test_plus::detail::reporter_human::fail_suite, micro_os_plus::micro_test_plus::detail::reporter_tap::fail_suite, micro_os_plus::micro_test_plus::detail::indent, micro_os_plus::micro_test_plus::detail::reporter_human::output_fail_prefix, micro_os_plus::micro_test_plus::detail::reporter_tap::output_fail_prefix, micro_os_plus::micro_test_plus::detail::reporter_tap::output_fail_suffix, micro_os_plus::micro_test_plus::detail::reporter_human::output_pass_prefix, micro_os_plus::micro_test_plus::detail::reporter_tap::output_pass_prefix, micro_os_plus::micro_test_plus::detail::reporter_tap::pass_without_text, micro_os_plus::micro_test_plus::detail::reporter_human::skip_test_case and micro_os_plus::micro_test_plus::detail::reporter_tap::skip_test_case.
File Listing
The file content with the documentation metadata removed is:
Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.