|
micro-test-plus 3.3.1
µTest++ Testing Framework
|
Reporter to display test results, including operand values and types for failures. More...
#include <micro-os-plus/micro-test-plus.h>
Public Member Functions | |
| virtual | ~test_reporter () |
| Default constructor for the test_reporter class. | |
| virtual void | begin_test (size_t test_suites_count)=0 |
| Mark the beginning of a test. | |
| virtual void | begin_test_case (const char *name)=0 |
| Mark the beginning of a test case. | |
| virtual void | begin_test_suite (const char *name)=0 |
| Mark the beginning of a test suite. | |
| auto | color (const bool cond) |
| Selects the appropriate colour code based on a 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 | end_test_suite (test_suite_base &suite)=0 |
| Mark the end of a test suite. | |
| virtual void | endline (void)=0 |
| Inserts a line ending into the output buffer. | |
| template<class Expr_T> | |
| void | fail (Expr_T &expr, bool abort, std::string &message, const reflection::source_location &location) |
| Report a failed condition. | |
| virtual void | flush (void)=0 |
| Flush the current buffered content. | |
| test_reporter & | operator<< (bool v) |
| Output operator for boolean values. | |
| test_reporter & | operator<< (char *s) |
| Output operator for a mutable character string. | |
| test_reporter & | operator<< (char c) |
| Output operator for a single character. | |
| test_reporter & | operator<< (const char *s) |
| Output operator for a constant character string. | |
| template<class Lhs_T, class Rhs_T> | |
| test_reporter & | operator<< (const detail::and_< Lhs_T, Rhs_T > &op) |
| Output operator to display and() expressions. | |
| template<class Lhs_T, class Rhs_T> | |
| test_reporter & | operator<< (const detail::eq_< Lhs_T, Rhs_T > &op) |
| Output operator to display eq() expressions. | |
| template<class Lhs_T, class Rhs_T> | |
| test_reporter & | operator<< (const detail::ge_< Lhs_T, Rhs_T > &op) |
| Output operator to display ge() expressions. | |
| template<class Lhs_T, class Rhs_T> | |
| test_reporter & | operator<< (const detail::gt_< Lhs_T, Rhs_T > &op) |
| Output operator to display gt() expressions. | |
| template<class Lhs_T, class Rhs_T> | |
| test_reporter & | operator<< (const detail::le_< Rhs_T, Lhs_T > &op) |
| Output operator to display le() expressions. | |
| template<class Lhs_T, class Rhs_T> | |
| test_reporter & | operator<< (const detail::lt_< Rhs_T, Lhs_T > &op) |
| Output operator to display lt() expressions. | |
| template<class Lhs_T, class Rhs_T> | |
| test_reporter & | operator<< (const detail::ne_< Lhs_T, Rhs_T > &op) |
| Output operator to display ne() expressions. | |
| template<class T> | |
| test_reporter & | operator<< (const detail::not_< T > &op) |
| Output operator to display not() expressions. | |
| template<class Expr_T> | |
| test_reporter & | operator<< (const detail::nothrow_< Expr_T > &op) |
| Output operator to display nothrow expressions. | |
| template<class Lhs_T, class Rhs_T> | |
| test_reporter & | operator<< (const detail::or_< Lhs_T, Rhs_T > &op) |
| Output operator to display or() expressions. | |
| template<class Expr_T, class Exception_T> | |
| test_reporter & | operator<< (const detail::throws_< Expr_T, Exception_T > &op) |
| Output operator to display throws expressions for a specific exception type. | |
| template<class Expr_T> | |
| test_reporter & | operator<< (const detail::throws_< Expr_T, void > &op) |
| Output operator to display throws expressions for any exception. | |
| template<class T> | |
| test_reporter & | operator<< (const T &t) |
| Output operator for types with a getter. | |
| template<class T> | |
| test_reporter & | operator<< (const type_traits::genuine_integral_value< T > &v) |
| Output operator to display genuine integers, without the type suffix. | |
| test_reporter & | operator<< (double v) |
| Output operator for double values. | |
| test_reporter & | operator<< (float v) |
| Output operator for float values. | |
| test_reporter & | operator<< (long double v) |
| Output operator for long double values. | |
| test_reporter & | operator<< (signed char c) |
| Output operator for signed char values. | |
| test_reporter & | operator<< (signed int v) |
| Output operator for signed int values. | |
| test_reporter & | operator<< (signed long long v) |
| Output operator for signed long long values. | |
| test_reporter & | operator<< (signed long v) |
| Output operator for signed long values. | |
| test_reporter & | operator<< (signed short v) |
| Output operator for signed short values. | |
| test_reporter & | operator<< (std::nullptr_t) |
| Output operator for nullptr. | |
| test_reporter & | operator<< (std::string_view sv) |
| Output operator for std::string_view. | |
| template<class T, type_traits::requires_t< type_traits::is_container_v< T > and not type_traits::has_npos_v< T > > = 0> | |
| test_reporter & | operator<< (T &&t) |
| Output operator to display containers. Iterates all members. | |
| template<typename T> | |
| test_reporter & | operator<< (T *v) |
| Output operator to display any pointer. | |
| test_reporter & | operator<< (test_reporter &(*func)(test_reporter &)) |
| Output operator to display the endl. | |
| test_reporter & | operator<< (unsigned char c) |
| Output operator for unsigned char values. | |
| test_reporter & | operator<< (unsigned int v) |
| Output operator for unsigned int values. | |
| test_reporter & | operator<< (unsigned long long v) |
| Output operator for unsigned long long values. | |
| test_reporter & | operator<< (unsigned long v) |
| Output operator for unsigned long values. | |
| test_reporter & | operator<< (unsigned short v) |
| Output operator for unsigned short values. | |
| virtual void | output (void)=0 |
| Output the current buffered content. | |
| template<class Expr_T> | |
| void | pass (Expr_T &expr, std::string &message) |
| Report a passed condition. | |
Public Attributes | |
| bool | add_empty_line { true } |
| Controls whether to add an empty line between successful test cases. | |
| verbosity_t | verbosity {} |
| The verbosity level for test reporting. | |
Protected Member Functions | |
| 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 | output_fail_suffix_ (const reflection::source_location &location, bool abort)=0 |
| Outputs the suffix for a failing condition. | |
| virtual void | output_pass_prefix_ (std::string &message)=0 |
| Outputs the prefix for a passing condition. | |
| virtual void | output_pass_suffix_ (void)=0 |
| Outputs the suffix for a passing condition. | |
Protected Attributes | |
| colors | colors_ {} |
| ANSI colour codes for output formatting. | |
| bool | is_in_test_case_ = false |
| Indicates whether the reporter is currently within a test case. | |
| std::string | out_ {} |
| Internal output buffer for accumulating report content. | |
The test_reporter class is responsible for formatting and presenting test results within the µTest++ framework. It provides a comprehensive suite of output operators for a wide range of data types, containers, and comparator expressions, enabling detailed and informative reporting of test outcomes.
For failed tests, the reporter prints the actual values of the operands along with their types, supporting precise diagnostics and efficient debugging. The class supports multiple verbosity levels and colour-coded output to distinguish between successful and failed tests, thereby enhancing the clarity and professionalism of test reports.
The test_reporter also offers methods for reporting the commencement and completion of test cases and suites, as well as for handling pass and fail conditions. Additional features include output stream manipulators, support for exception-related expressions, and configurable formatting options.
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 202 of file test-reporter.h.
|
virtualdefault |
|
pure virtual |
| test_suites_count | The number of test suites. |
Implemented in micro_os_plus::micro_test_plus::test_reporter_basic, and micro_os_plus::micro_test_plus::test_reporter_tap.
|
pure virtual |
| name | The name of the test case. |
Implemented in micro_os_plus::micro_test_plus::test_reporter_basic, and micro_os_plus::micro_test_plus::test_reporter_tap.
|
pure virtual |
| name | The name of the test suite. |
Implemented in micro_os_plus::micro_test_plus::test_reporter_basic, and micro_os_plus::micro_test_plus::test_reporter_tap.
|
inlinenodiscard |
| 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 221 of file test-reporter.h.
References colors_.
Referenced by operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), and operator<<().
|
pure virtual |
| runner | Reference to the test runner. |
Implemented in micro_os_plus::micro_test_plus::test_reporter_basic, and micro_os_plus::micro_test_plus::test_reporter_tap.
References micro_os_plus::micro_test_plus::runner.
|
pure virtual |
| name | The name of the test case. |
Implemented in micro_os_plus::micro_test_plus::test_reporter_basic, and micro_os_plus::micro_test_plus::test_reporter_tap.
|
pure virtual |
| suite | Reference to the test suite base. |
Implemented in micro_os_plus::micro_test_plus::test_reporter_basic, and micro_os_plus::micro_test_plus::test_reporter_tap.
|
pure virtual |
Implemented in micro_os_plus::micro_test_plus::test_reporter_basic, and micro_os_plus::micro_test_plus::test_reporter_tap.
| void micro_os_plus::micro_test_plus::test_reporter::fail | ( | Expr_T & | expr, |
| bool | abort, | ||
| std::string & | message, | ||
| const reflection::source_location & | location ) |
| Expr_T | The expression type. |
| expr | The evaluated expression. |
| abort | Whether to abort execution after failure. |
| message | The message to display. |
| location | The source location of the failure. |
This function reports a test failure and formats the output in a clear and consistent manner. It provides contextual information, including the precise source location, and appends the evaluated expression when applicable. The failure handling process ensures uniformity in the presentation of unsuccessful test cases, aiding in the rapid identification and diagnosis of issues within test reports.
Definition at line 445 of file test-reporter-inlines.h.
References micro_os_plus::micro_test_plus::current_test_suite, micro_os_plus::micro_test_plus::type_traits::is_op_v, output_fail_prefix_(), and output_fail_suffix_().
|
pure virtual |
Implemented in micro_os_plus::micro_test_plus::test_reporter_basic, and micro_os_plus::micro_test_plus::test_reporter_tap.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | bool | v | ) |
| v | The boolean value to output. |
This operator overload appends the string representation of the specified boolean value to the internal output buffer of the test_reporter. It enables clear and direct streaming of boolean results into the reporter, supporting precise and readable formatting of test output across all test cases and folders.
Definition at line 168 of file test-reporter.cpp.
References out_.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | char * | s | ) |
| s | The string to output. |
This operator overload appends the contents of the provided modifiable C-style string to the internal output buffer of the test_reporter. It enables efficient streaming of mutable string data into the reporter, supporting clear and flexible formatting of test output across all test cases and folders.
Definition at line 153 of file test-reporter.cpp.
References out_.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | char | c | ) |
| c | The character to output. |
This operator overload appends the specified character to the internal output buffer of the test_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 123 of file test-reporter.cpp.
References out_.
| test_reporter & micro_os_plus::micro_test_plus::test_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 test_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 138 of file test-reporter.cpp.
References out_.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::and_< Lhs_T, Rhs_T > & | op | ) |
| Lhs_T | The left-hand side type. |
| Rhs_T | The right-hand side type. |
| op | The logical conjunction (AND) expression. |
This operator overload enables the test_reporter to output logical conjunction (AND) expressions in a clear and structured format.
The left-hand side and right-hand side expressions are enclosed in parentheses and separated by the word "and", with appropriate colour highlighting applied for improved readability in test reports and diagnostics. This presentation assists in quickly identifying the components of logical assertions and facilitates efficient debugging of test failures involving compound conditions.
Definition at line 305 of file test-reporter-inlines.h.
References color(), colors_, micro_os_plus::micro_test_plus::detail::and_< Lhs_T, Rhs_T >::lhs(), and micro_os_plus::micro_test_plus::detail::and_< Lhs_T, Rhs_T >::rhs().
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::eq_< Lhs_T, Rhs_T > & | op | ) |
| Lhs_T | The left-hand side type. |
| Rhs_T | The right-hand side type. |
| op | The equality comparator expression. |
This operator overload enables the test_reporter to output equality comparison expressions in a clear and expressive format.
The left-hand side and right-hand side values are formatted and separated by the equality operator (==), with appropriate colour highlighting applied for improved readability in test reports and diagnostics. This structured output assists in quickly identifying the values involved in equality assertions and facilitates efficient debugging of test failures.
Definition at line 184 of file test-reporter-inlines.h.
References color(), colors_, micro_os_plus::micro_test_plus::detail::eq_< Lhs_T, Rhs_T >::lhs(), and micro_os_plus::micro_test_plus::detail::eq_< Lhs_T, Rhs_T >::rhs().
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::ge_< Lhs_T, Rhs_T > & | op | ) |
| Lhs_T | The left-hand side type. |
| Rhs_T | The right-hand side type. |
| op | The greater-than-or-equal-to comparator expression. |
This operator overload enables the test_reporter to output greater-than-or-equal-to comparison expressions in a clear and expressive format.
The left-hand side and right-hand side values are formatted and separated by the greater-than-or-equal-to operator (>=), with appropriate colour highlighting applied for improved readability in test reports and diagnostics. This structured output assists in quickly identifying the values involved in greater-than-or-equal-to assertions and facilitates efficient debugging of test failures.
Definition at line 245 of file test-reporter-inlines.h.
References color(), colors_, micro_os_plus::micro_test_plus::detail::ge_< Lhs_T, Rhs_T >::lhs(), and micro_os_plus::micro_test_plus::detail::ge_< Lhs_T, Rhs_T >::rhs().
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::gt_< Lhs_T, Rhs_T > & | op | ) |
| Lhs_T | The left-hand side type. |
| Rhs_T | The right-hand side type. |
| op | The greater-than comparator expression. |
This operator overload enables the test_reporter to output greater-than comparison expressions in a clear and expressive format.
The left-hand side and right-hand side values are formatted and separated by the greater-than operator (>), with appropriate colour highlighting applied for improved readability in test reports and diagnostics. This structured output assists in quickly identifying the values involved in greater-than assertions and facilitates efficient debugging of test failures.
Definition at line 224 of file test-reporter-inlines.h.
References color(), colors_, micro_os_plus::micro_test_plus::detail::gt_< Lhs_T, Rhs_T >::lhs(), and micro_os_plus::micro_test_plus::detail::gt_< Lhs_T, Rhs_T >::rhs().
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::le_< Rhs_T, Lhs_T > & | op | ) |
| Lhs_T | The left-hand side type. |
| Rhs_T | The right-hand side type. |
| op | The less-than-or-equal-to comparator expression. |
This operator overload enables the test_reporter to output less-than-or-equal-to comparison expressions in a clear and expressive format.
The left-hand side and right-hand side values are formatted and separated by the less-than-or-equal-to operator (<=), with appropriate colour highlighting applied for improved readability in test reports and diagnostics. This structured output assists in quickly identifying the values involved in less-than-or-equal-to assertions and facilitates efficient debugging of test failures.
Definition at line 285 of file test-reporter-inlines.h.
References color(), colors_, micro_os_plus::micro_test_plus::detail::le_< Lhs_T, Rhs_T >::lhs(), and micro_os_plus::micro_test_plus::detail::le_< Lhs_T, Rhs_T >::rhs().
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::lt_< Rhs_T, Lhs_T > & | op | ) |
| Lhs_T | The left-hand side type. |
| Rhs_T | The right-hand side type. |
| op | The less-than comparator expression. |
This operator overload enables the test_reporter to output less-than comparison expressions in a clear and expressive format.
The left-hand side and right-hand side values are formatted and separated by the less-than operator (<), with appropriate colour highlighting applied for improved readability in test reports and diagnostics. This structured output assists in quickly identifying the values involved in less-than assertions and facilitates efficient debugging of test failures.
Definition at line 264 of file test-reporter-inlines.h.
References color(), colors_, micro_os_plus::micro_test_plus::detail::lt_< Lhs_T, Rhs_T >::lhs(), and micro_os_plus::micro_test_plus::detail::lt_< Lhs_T, Rhs_T >::rhs().
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::ne_< Lhs_T, Rhs_T > & | op | ) |
| Lhs_T | The left-hand side type. |
| Rhs_T | The right-hand side type. |
| op | The inequality comparator expression. |
This operator overload enables the test_reporter to output inequality comparison expressions in a clear and expressive format.
The left-hand side and right-hand side values are formatted and separated by the inequality operator (!=), with appropriate colour highlighting applied for improved readability in test reports and diagnostics. This structured output assists in quickly identifying the values involved in inequality assertions and facilitates efficient debugging of test failures.
Definition at line 204 of file test-reporter-inlines.h.
References color(), colors_, micro_os_plus::micro_test_plus::detail::ne_< Lhs_T, Rhs_T >::lhs(), and micro_os_plus::micro_test_plus::detail::ne_< Lhs_T, Rhs_T >::rhs().
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::not_< T > & | op | ) |
| T | The operand type. |
| op | The logical negation expression. |
This operator overload enhances readability and clarity by formatting the output when handling negated expressions. It applies colour styling for improved distinction and appends the negated value accordingly, ensuring that logical negations are clearly represented in test reports and diagnostics.
Definition at line 341 of file test-reporter-inlines.h.
References color(), colors_, and micro_os_plus::micro_test_plus::detail::not_< T >::value().
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::nothrow_< Expr_T > & | op | ) |
| Expr_T | The expression type. |
| op | The nothrow comparator expression. |
This operator overload formats output for expressions that do not throw exceptions. It applies colour styling for clarity and ensures a structured and concise representation of exception safety within test reports.
The output highlights the nothrow qualifier, making it immediately apparent when an expression is guaranteed not to throw, thereby improving the readability and professionalism of the test output.
Definition at line 397 of file test-reporter-inlines.h.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::or_< Lhs_T, Rhs_T > & | op | ) |
| Lhs_T | The left-hand side type. |
| Rhs_T | The right-hand side type. |
| op | The logical disjunction (OR) expression. |
This operator overload enables the test_reporter to output logical disjunction (OR) expressions in a clear and structured format.
The left-hand side and right-hand side expressions are enclosed in parentheses and separated by the word "or", with appropriate colour highlighting applied for improved readability in test reports and diagnostics. This presentation assists in quickly identifying the components of logical assertions and facilitates efficient debugging of test failures involving compound conditions.
Definition at line 325 of file test-reporter-inlines.h.
References color(), colors_, micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::lhs(), and micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::rhs().
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::throws_< Expr_T, Exception_T > & | op | ) |
| Expr_T | The expression type. |
| Exception_T | The exception type. |
| op | The throws comparator expression. |
This operator overload provides structured output for expressions that may throw exceptions. It applies colour styling for clarity and includes the exception type name for precise identification.
When invoked, the output highlights the throws qualifier along with the specific exception type, making it immediately apparent which exception is expected. This enhances the readability and professionalism of test reports, and assists in the precise identification and debugging of exception-related test cases.
Definition at line 361 of file test-reporter-inlines.h.
References color(), colors_, and micro_os_plus::micro_test_plus::reflection::type_name().
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const detail::throws_< Expr_T, void > & | op | ) |
| Expr_T | The expression type. |
| op | The throws comparator expression. |
This operator overload formats output for expressions that may throw exceptions. It applies colour styling for clarity and ensures a structured representation of the exception handling mechanism.
When invoked, the output highlights the throws qualifier, making it immediately apparent when an expression is expected to throw, thereby improving the readability and professionalism of the test output.
Definition at line 380 of file test-reporter-inlines.h.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const T & | t | ) |
| T | The type with a getter method. |
| t | The object to output. |
References micro_os_plus::micro_test_plus::type_traits::has_npos_v.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | const type_traits::genuine_integral_value< T > & | v | ) |
| T | The underlying integral type. |
| v | The strongly-typed integral value to output. |
This operator overload enables the test_reporter to output strongly-typed integral values in a clear and consistent decimal format.
The value is converted to a string using std::to_string after being cast to long long, ensuring accurate formatting and compatibility across platforms. The resulting string is appended to the internal output buffer, allowing integral values to be included in test reports and diagnostics.
This approach ensures precise and unambiguous representation of integral values, which is particularly advantageous for verifying test results and facilitating debugging.
Definition at line 134 of file test-reporter-inlines.h.
References micro_os_plus::micro_test_plus::type_traits::genuine_integral_value< T >::get(), and out_.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | double | v | ) |
| v | The double value to output. |
This operator overload appends the string representation of the specified double-precision floating-point value to the internal output buffer of the test_reporter. It enables precise and readable streaming of double values into the reporter, supporting clear formatting of test output across all test cases and folders.
Definition at line 372 of file test-reporter.cpp.
References out_.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | float | v | ) |
| v | The float value to output. |
This operator overload appends the string representation of the specified floating-point value to the internal output buffer of the test_reporter, followed by the character 'f' to indicate a float type. It enables precise and readable streaming of float values into the reporter, supporting clear formatting of test output across all test cases and folders.
Definition at line 356 of file test-reporter.cpp.
References out_.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | long double | v | ) |
| v | The long double value to output. |
This operator overload appends the string representation of the specified long double-precision floating-point value to the internal output buffer of the test_reporter, followed by the character 'l' to indicate a long double type. It enables precise and readable streaming of long double values into the reporter, supporting clear formatting of test output across all test cases and folders.
Definition at line 388 of file test-reporter.cpp.
References out_.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | signed char | c | ) |
| c | The signed char value to output. |
This operator overload appends the string representation of the specified signed character to the internal output buffer of the test_reporter. It enables precise and readable streaming of character values into the reporter, supporting clear formatting of test output across all test cases and folders.
Definition at line 197 of file test-reporter.cpp.
References out_.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | signed int | v | ) |
| v | The signed int value to output. |
This operator overload appends the string representation of the specified signed integer to the internal output buffer of the test_reporter. It enables precise and readable streaming of signed integer values into the reporter, supporting clear formatting of test output across all test cases and folders.
Definition at line 261 of file test-reporter.cpp.
References out_.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | signed long long | v | ) |
| v | The signed long long value to output. |
This operator overload appends the string representation of the specified signed long long integer to the internal output buffer of the test_reporter. It enables precise and readable streaming of signed long long values into the reporter, supporting clear formatting of test output across all test cases and folders.
Definition at line 324 of file test-reporter.cpp.
References out_.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | signed long | v | ) |
| v | The signed long value to output. |
This operator overload appends the string representation of the specified signed long integer to the internal output buffer of the test_reporter. It enables precise and readable streaming of signed long values into the reporter, supporting clear formatting of test output across all test cases and folders.
Definition at line 292 of file test-reporter.cpp.
References out_.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | signed short | v | ) |
| v | The signed short value to output. |
This operator overload appends the string representation of the specified signed short integer to the internal output buffer of the test_reporter. It enables precise and readable streaming of signed short values into the reporter, supporting clear formatting of test output across all test cases and folders.
Definition at line 229 of file test-reporter.cpp.
References out_.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | std::nullptr_t | ) |
This operator overload appends the string "nullptr" to the internal output buffer of the test_reporter. It enables clear and explicit streaming of null pointer values into the reporter, supporting precise and readable formatting of test output across all test cases and folders.
Definition at line 182 of file test-reporter.cpp.
References out_.
| test_reporter & micro_os_plus::micro_test_plus::test_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 test_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 109 of file test-reporter.cpp.
References out_.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | T && | t | ) |
| T | The container type. |
| t | The container to output. |
This operator overload enables the test_reporter to output container types in a structured and readable format.
The contents of the container are enclosed in curly braces and each element is separated by a comma and a space. The operator iterates over the container, formatting each element in sequence, which ensures clarity and consistency in test reports and diagnostics.
This approach provides a clear visual representation of container contents, making it easier to interpret test results and debug issues involving collections of values.
Definition at line 158 of file test-reporter-inlines.h.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | T * | v | ) |
| T | The type of the pointer. |
| v | The pointer value to output. |
This operator overload enables the test_reporter to output pointer values in a consistent and readable hexadecimal format.
The pointer is formatted as a string using snprintf with the p format specifier, ensuring portability across platforms. 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 91 of file test-reporter-inlines.h.
References out_.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | test_reporter &(* | func )(test_reporter &) | ) |
| func | Function pointer to the stream manipulator. |
This operator overload enables manipulators, such as endl, to be used with the test_reporter stream in a manner similar to standard C++ streams. When a manipulator function is passed, it is invoked with the current test_reporter instance, allowing for seamless integration of stream operations and improved readability of test output across all test cases and folders.
Definition at line 93 of file test-reporter.cpp.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | unsigned char | c | ) |
| c | The unsigned char value to output. |
This operator overload appends the string representation of the specified unsigned character to the internal output buffer of the test_reporter. It enables precise and readable streaming of unsigned character values into the reporter, supporting clear formatting of test output across all test cases and folders.
Definition at line 213 of file test-reporter.cpp.
References out_.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | unsigned int | v | ) |
| v | The unsigned int value to output. |
This operator overload appends the string representation of the specified unsigned integer to the internal output buffer of the test_reporter. It enables precise and readable streaming of unsigned integer values into the reporter, supporting clear formatting of test output across all test cases and folders.
Definition at line 276 of file test-reporter.cpp.
References out_.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | unsigned long long | v | ) |
| v | The unsigned long long value to output. |
This operator overload appends the string representation of the specified unsigned long long integer to the internal output buffer of the test_reporter. It enables precise and readable streaming of unsigned long long values into the reporter, supporting clear formatting of test output across all test cases and folders.
Definition at line 340 of file test-reporter.cpp.
References out_.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | unsigned long | v | ) |
| v | The unsigned long value to output. |
This operator overload appends the string representation of the specified unsigned long integer to the internal output buffer of the test_reporter. It enables precise and readable streaming of unsigned long values into the reporter, supporting clear formatting of test output across all test cases and folders.
Definition at line 308 of file test-reporter.cpp.
References out_.
| test_reporter & micro_os_plus::micro_test_plus::test_reporter::operator<< | ( | unsigned short | v | ) |
| v | The unsigned short value to output. |
This operator overload appends the string representation of the specified unsigned short integer to the internal output buffer of the test_reporter. It enables precise and readable streaming of unsigned short values into the reporter, supporting clear formatting of test output across all test cases and folders.
Definition at line 245 of file test-reporter.cpp.
References out_.
|
pure virtual |
Implemented in micro_os_plus::micro_test_plus::test_reporter_basic, and micro_os_plus::micro_test_plus::test_reporter_tap.
|
protectedpure virtual |
| message | The message to display. |
| hasExpression | Whether the failure is associated with an expression. |
| location | The source location of the failure. |
Implemented in micro_os_plus::micro_test_plus::test_reporter_basic, and micro_os_plus::micro_test_plus::test_reporter_tap.
Referenced by fail().
|
protectedpure virtual |
| location | The source location of the failure. |
| abort | Whether to abort execution after failure. |
Implemented in micro_os_plus::micro_test_plus::test_reporter_basic, and micro_os_plus::micro_test_plus::test_reporter_tap.
Referenced by fail().
|
protectedpure virtual |
| message | The message to display. |
Implemented in micro_os_plus::micro_test_plus::test_reporter_basic, and micro_os_plus::micro_test_plus::test_reporter_tap.
Referenced by pass().
|
protectedpure virtual |
Implemented in micro_os_plus::micro_test_plus::test_reporter_basic, and micro_os_plus::micro_test_plus::test_reporter_tap.
Referenced by pass().
| void micro_os_plus::micro_test_plus::test_reporter::pass | ( | Expr_T & | expr, |
| std::string & | message ) |
| Expr_T | The expression type. |
| expr | The evaluated expression. |
| message | The message to display. |
This operator overload formats output for expressions that do not throw exceptions. It applies colour styling for clarity and ensures a structured representation of exception safety.
When invoked, the function outputs a pass prefix, followed by either the provided message or, if the message is empty, the evaluated expression itself. It then appends a pass suffix to complete the output. This approach guarantees that successful test outcomes are presented in a clear and consistent manner, enhancing the readability and professionalism of test reports.
Definition at line 419 of file test-reporter-inlines.h.
References micro_os_plus::micro_test_plus::current_test_suite, output_pass_prefix_(), and output_pass_suffix_().
| bool micro_os_plus::micro_test_plus::test_reporter::add_empty_line { true } |
Used to nicely format the output.
Definition at line 756 of file test-reporter.h.
Referenced by micro_os_plus::micro_test_plus::test_reporter_tap::begin_test(), micro_os_plus::micro_test_plus::test_reporter_basic::begin_test_case(), micro_os_plus::micro_test_plus::test_reporter_tap::begin_test_case(), micro_os_plus::micro_test_plus::test_reporter_basic::begin_test_suite(), micro_os_plus::micro_test_plus::test_reporter_tap::begin_test_suite(), micro_os_plus::micro_test_plus::test_reporter_basic::end_test_case(), micro_os_plus::micro_test_plus::test_reporter_tap::end_test_case(), micro_os_plus::micro_test_plus::test_reporter_basic::end_test_suite(), and micro_os_plus::micro_test_plus::test_reporter_tap::end_test_suite().
|
protected |
Definition at line 818 of file test-reporter.h.
Referenced by micro_os_plus::micro_test_plus::test_reporter_basic::test_reporter_basic(), color(), micro_os_plus::micro_test_plus::test_reporter_basic::end_test_case(), micro_os_plus::micro_test_plus::test_reporter_basic::end_test_suite(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), micro_os_plus::micro_test_plus::test_reporter_basic::output_fail_prefix_(), and micro_os_plus::micro_test_plus::test_reporter_basic::output_pass_prefix_().
|
protected |
Definition at line 828 of file test-reporter.h.
Referenced by micro_os_plus::micro_test_plus::test_reporter_basic::begin_test_case(), micro_os_plus::micro_test_plus::test_reporter_tap::begin_test_case(), micro_os_plus::micro_test_plus::test_reporter_basic::end_test_case(), micro_os_plus::micro_test_plus::test_reporter_tap::end_test_case(), micro_os_plus::micro_test_plus::test_reporter_basic::output_fail_prefix_(), micro_os_plus::micro_test_plus::test_reporter_tap::output_fail_prefix_(), micro_os_plus::micro_test_plus::test_reporter_basic::output_pass_prefix_(), and micro_os_plus::micro_test_plus::test_reporter_tap::output_pass_prefix_().
|
protected |
Definition at line 823 of file test-reporter.h.
Referenced by micro_os_plus::micro_test_plus::test_reporter_basic::begin_test_case(), micro_os_plus::micro_test_plus::test_reporter_tap::begin_test_case(), micro_os_plus::micro_test_plus::test_reporter_basic::end_test_case(), micro_os_plus::micro_test_plus::test_reporter_tap::end_test_case(), micro_os_plus::micro_test_plus::test_reporter_basic::endline(), micro_os_plus::micro_test_plus::test_reporter_tap::endline(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), micro_os_plus::micro_test_plus::test_reporter_basic::output(), and micro_os_plus::micro_test_plus::test_reporter_tap::output().
| verbosity_t micro_os_plus::micro_test_plus::test_reporter::verbosity {} |
Definition at line 761 of file test-reporter.h.
Referenced by micro_os_plus::micro_test_plus::test_reporter_tap::begin_test(), micro_os_plus::micro_test_plus::test_reporter_basic::begin_test_case(), micro_os_plus::micro_test_plus::test_reporter_tap::begin_test_case(), micro_os_plus::micro_test_plus::test_reporter_basic::begin_test_suite(), micro_os_plus::micro_test_plus::test_reporter_tap::begin_test_suite(), micro_os_plus::micro_test_plus::test_reporter_tap::end_test(), micro_os_plus::micro_test_plus::test_reporter_basic::end_test_case(), micro_os_plus::micro_test_plus::test_reporter_tap::end_test_case(), micro_os_plus::micro_test_plus::test_reporter_basic::end_test_suite(), and micro_os_plus::micro_test_plus::test_reporter_tap::end_test_suite().