detail Namespace
Internal implementation details for the µTest++ framework. More...
Definition
Classes Index
| struct | and_<Lhs_T, Rhs_T> |
|
Logical AND comparator struct template. More... | |
| struct | assertion<Expr_T> |
|
Assertion struct template for parameter passing to the evaluator. More... | |
| struct | binary_op_<Lhs_T, Rhs_T> |
|
Common base struct template for binary comparators. More... | |
| struct | callable_op_ |
|
Common base struct for callable-wrapping operators. More... | |
| struct | colours |
|
Colours used to highlight pass and fail results in test reports. More... | |
| class | deferred_reporter |
|
Deferred reporter class for a specific expression. More... | |
| class | deferred_reporter_base |
|
Base class for a deferred reporter that collects messages into a string. More... | |
| struct | eq_<Lhs_T, Rhs_T> |
|
Equality comparator struct template. More... | |
| class | expression_formatter |
|
Formats values and expressions into an owned string buffer. More... | |
| struct | ge_<Lhs_T, Rhs_T> |
|
Greater than or equal comparator struct template. More... | |
| struct | gt_<Lhs_T, Rhs_T> |
|
Greater than comparator struct template. More... | |
| struct | indent_t |
|
Parameterised stream manipulator for outputting indentation. More... | |
| struct | le_<Lhs_T, Rhs_T> |
|
Less than or equal comparator struct template. More... | |
| struct | lt_<Lhs_T, Rhs_T> |
|
Less than comparator struct template. More... | |
| struct | ne_<Lhs_T, Rhs_T> |
|
Non-equality comparator struct template. More... | |
| struct | not_<T> |
|
Logical NOT comparator struct template. More... | |
| struct | nothrow_<Callable_T> |
|
Operator struct template to check if an expression does not throw any exception. More... | |
| struct | or_<Lhs_T, Rhs_T> |
|
Logical OR comparator struct template. More... | |
| class | runnable<Self_T> |
|
CRTP base class factoring out callable storage, rule-of-five, and run() logic shared by subtest and suite. More... | |
| class | runnable_base |
|
Non-template base for all runnable objects (suites and subtests). More... | |
| class | runner_totals |
|
Aggregated pass/fail/subtest counters for a node in the test tree. More... | |
| class | test_node |
|
Base class for runners and runable tests. More... | |
| struct | throws_<Callable_T, Exception_T> |
|
Operator struct template to check if an expression throws a specific exception. More... | |
| struct | throws_<Callable_T, void> |
|
Operator struct template to check if an expression throws any exception. More... | |
| class | timestamp |
|
A single point-in-time measurement, wrapping a timespec value. More... | |
| class | timestamps |
|
A begin/end timestamp pair used to measure elapsed time. More... | |
| struct | unary_op_<T> |
|
Common base struct template for unary comparators. More... | |
Functions Index
template <typename Lhs_T, typename Rhs_T> | |
| and_ (const Lhs_T &, const Rhs_T &) -> and_< Lhs_T, Rhs_T > | |
template <class T> | |
| void | append_number_ (std::string &buffer, T v) |
|
Appends the string representation of a numeric value to a buffer, using std::to_chars for allocation-free, locale-independent formatting. More... | |
template <typename Lhs_T, typename Rhs_T> | |
| eq_ (const Lhs_T &, const Rhs_T &) -> eq_< Lhs_T, Rhs_T > | |
template <typename Lhs_T, typename Rhs_T> | |
| ge_ (const Lhs_T &, const Rhs_T &) -> ge_< Lhs_T, Rhs_T > | |
template <class T> | |
| constexpr auto | get (const T &t) |
|
Generic getter function template for value retrieval. More... | |
template <typename Lhs_T, typename Rhs_T> | |
| gt_ (const Lhs_T &, const Rhs_T &) -> gt_< Lhs_T, Rhs_T > | |
template <typename Lhs_T, typename Rhs_T> | |
| le_ (const Lhs_T &, const Rhs_T &) -> le_< Lhs_T, Rhs_T > | |
template <typename Lhs_T, typename Rhs_T> | |
| lt_ (const Lhs_T &, const Rhs_T &) -> lt_< Lhs_T, Rhs_T > | |
template <typename Lhs_T, typename Rhs_T> | |
| ne_ (const Lhs_T &, const Rhs_T &) -> ne_< Lhs_T, Rhs_T > | |
template <typename T> | |
| not_ (const T &) -> not_< T > | |
template <typename Lhs_T, typename Rhs_T> | |
| or_ (const Lhs_T &, const Rhs_T &) -> or_< Lhs_T, Rhs_T > | |
| void | register_static_suite (static_runner &static_runner_ref, static_suite &static_suite_ref) |
|
Registers a static suite with a static runner. More... | |
| runner & | to_runner (static_runner &static_runner_ref) noexcept |
|
Converts a static_runner reference to a runner reference. More... | |
Variables Index
| constexpr colours | colours_red_green = ... |
Description
Internal implementation details for the µTest++ framework.
The detail namespace encapsulates the internal mechanisms, helper structures, and implementation utilities employed by the µTest++ testing framework. These components do not form part of the public API and may be modified without prior notice.
Within this namespace, one will find assertion handling, generic getter utilities, comparator structures for logical and relational operations, mechanisms for exception checking, and base classes for deferred reporting of test results.
All definitions within detail are intended exclusively for internal use, ensuring a clear distinction between user-facing and internal components. This approach enhances maintainability, mitigates the risk of naming conflicts, and keeps the public API succinct.
The relevant header files are organised within the include/micro-os-plus folder to maintain a structured and modular codebase.
Functions
and_()
|
append_number_()
|
Appends the string representation of a numeric value to a buffer, using std::to_chars for allocation-free, locale-independent formatting.
- Template Parameters
-
T The numeric type to format.
- Parameters
-
buffer The string to append to.
v The value to format.
- Returns
Nothing.
For long double, a platform-specific path is chosen:
- On Windows and on platforms where long double has the same storage width as double (e.g., ARM, RISC-V), the value is cast to double and formatted with std::to_chars.
- On x86-64 Linux/macOS with 80-bit extended precision, snprintf with Lg is used as a portable fallback because std::to_chars for long double may be unavailable when linking with lld.
For all other numeric types, std::to_chars is called directly, providing locale-independent, allocation-free formatting.
Definition at line 653 of file detail-inlines.h.
Referenced by micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<< and micro_os_plus::micro_test_plus::reporter::operator<<.
eq_()
|
ge_()
|
get()
| nodiscard constexpr |
Generic getter function template for value retrieval.
- Template Parameters
-
T The type from which the value is to be retrieved.
- Parameters
-
t The object or value to be accessed.
- Returns
The value obtained via the relevant getter implementation.
If the type T provides a get() member function, it is invoked and its result returned. Otherwise the argument itself is returned unchanged. The selection is performed at compile time via if constexpr with an inline requires expression.
Definition at line 81 of file detail-inlines.h.
Referenced by micro_os_plus::micro_test_plus::detail::eq_< Lhs_T, Rhs_T >::eq_, micro_os_plus::micro_test_plus::detail::ge_< Lhs_T, Rhs_T >::ge_, micro_os_plus::micro_test_plus::detail::gt_< Lhs_T, Rhs_T >::gt_, micro_os_plus::micro_test_plus::detail::le_< Lhs_T, Rhs_T >::le_, micro_os_plus::micro_test_plus::detail::lt_< Lhs_T, Rhs_T >::lt_, micro_os_plus::micro_test_plus::detail::ne_< Lhs_T, Rhs_T >::ne_, micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::lhs, micro_os_plus::micro_test_plus::detail::unary_op_< T >::operand, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<< and micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::rhs.
gt_()
|
le_()
|
lt_()
|
ne_()
|
not_()
|
or_()
|
register_static_suite()
|
Registers a static suite with a static runner.
This declaration allows test-inlines.h to request registration without requiring the complete static_runner type in that header.
- Parameters
-
static_runner_ref The destination static runner.
static_suite_ref The static suite to register.
Performs static-suite registration where static_runner is complete, allowing header-only template code to avoid direct dependence on runner.h include order.
Declaration at line 122 of file test.h, definition at line 93 of file runner.cpp.
Reference micro_os_plus::micro_test_plus::static_runner::register_static_suite.
Referenced by micro_os_plus::micro_test_plus::static_suite::static_suite.
to_runner()
| noexcept |
Converts a static_runner reference to a runner reference.
This declaration breaks the include-order cycle between test and runner headers. The definition is provided in a translation unit where both types are complete, so the conversion remains type-safe.
- Parameters
-
static_runner_ref The source static_runner reference.
- Returns
The same object viewed as its runner base.
Performs the static_runner to runner upcast where both types are complete, allowing headers with only forward declarations to request this conversion safely.
Declaration at line 109 of file test.h, definition at line 81 of file runner.cpp.
Variables
colours_red_green
| constexpr |
- Initialiser
-
= { "\033[0m", "\033[32m", "\033[31m" }
Definition at line 123 of file expression-formatter.h.
Referenced by micro_os_plus::micro_test_plus::reporter_human::reporter_human.
The documentation for this namespace was generated from the following files:
Generated via doxygen2docusaurus 2.2.0 by Doxygen 1.17.0.