test_node Class
Base class for runners and runable tests. More...
Declaration
Included Headers
Derived Classes
| class | runnable_base |
|
Non-template base for all runnable objects (suites and subtests). More... | |
| class | runner |
|
The test runner for the µTest++ framework. More... | |
Public Constructors Index
| test_node (const char *name) | |
|
Constructs a test node. More... | |
| test_node (const test_node &)=delete | |
|
Deleted copy constructor to prevent copying. More... | |
| test_node (test_node &&)=delete | |
|
Deleted move constructor to prevent moving. More... | |
Public Destructor Index
| ~test_node () | |
Public Operators Index
| test_node & | operator= (const test_node &)=delete |
|
Deleted copy assignment operator to prevent copying. More... | |
| test_node & | operator= (test_node &&)=delete |
|
Deleted move assignment operator to prevent moving. More... | |
Public Member Functions Index
| const char * | name (void) const noexcept |
|
Gets the node name. More... | |
| const runner_totals & | totals () const noexcept |
|
Gets the totals for the test (const overload). More... | |
| runner_totals & | totals () noexcept |
|
Gets the totals for the test. More... | |
Protected Member Attributes Index
| const char * | name_ |
|
The test node name. More... | |
| runner_totals | totals_ |
|
Totals for the test node, including nested cases. More... | |
Description
Base class for runners and runable tests.
The test_node class provides the foundational interface for managing test within the µTest++ framework. It maintains counters for successful and failed checks, tracks test cases, and offers methods for marking the commencement and completion of test cases and suites.
This class ensures consistent state management and reporting for all derived classes. It also provides utility methods for querying the node's name, the number of successful and failed checks, the number of test cases, and the overall result of the node.
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 145 of file test.h.
Public Constructors
test_node()
|
Constructs a test node.
- Parameters
-
[in] name The test node name.
Stores the supplied name pointer, which is expected to point to a string with a lifetime exceeding that of this instance. If tracing is enabled, the name is output for diagnostic purposes.
Declaration at line 153 of file test.h, definition at line 84 of file test.cpp.
Referenced by micro_os_plus::micro_test_plus::detail::runnable_base::runnable_base, micro_os_plus::micro_test_plus::runner::runner, micro_os_plus::micro_test_plus::runner::runner, test_node, test_node, operator= and operator=.
test_node()
| delete |
test_node()
Public Destructor
~test_node()
| virtual |
Virtual destructor for the test_node class.
No resources are owned by test_node; the destructor performs no explicit clean-up. If tracing is enabled, the node name is output for diagnostic purposes.
Declaration at line 182 of file test.h, definition at line 107 of file test.cpp.
Reference name_.
Public Operators
operator=()
| delete |
operator=()
Public Member Functions
name()
| inline nodiscard noexcept |
Gets the node name.
- Parameters
None.
- Returns
A pointer to the null-terminated test node name.
Returns a pointer to the null-terminated name stored in name_.
Declaration at line 194 of file test.h, definition at line 91 of file test-inlines.h.
Reference name_.
Referenced by micro_os_plus::micro_test_plus::detail::runnable< Self_T >::runnable, micro_os_plus::micro_test_plus::detail::runnable_base::runnable_base, micro_os_plus::micro_test_plus::runner::runner, micro_os_plus::micro_test_plus::runner::runner, micro_os_plus::micro_test_plus::static_runner::static_runner, micro_os_plus::micro_test_plus::static_runner::static_runner, test_node, micro_os_plus::micro_test_plus::detail::runnable_base::after_subtest_create_, 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_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, micro_os_plus::micro_test_plus::runner::operator= and micro_os_plus::micro_test_plus::runner::suite.
totals()
| inline nodiscard noexcept |
Gets the totals for the test (const overload).
- Parameters
None.
- Returns
A const reference to the runner_totals instance.
Returns a const reference to the runner_totals member.
Declaration at line 215 of file test.h, definition at line 111 of file test-inlines.h.
Reference totals_.
totals()
| inline nodiscard noexcept |
Gets the totals for the test.
- Parameters
None.
- Returns
A reference to the runner_totals instance.
Returns a reference to the runner_totals member.
Declaration at line 205 of file test.h, definition at line 101 of file test-inlines.h.
Reference totals_.
Referenced by micro_os_plus::micro_test_plus::detail::runnable_base::after_subtest_create_, 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 operator=.
Protected Member Attributes
name_
| protected |
The test node name.
Derived classes may access this member directly in addition to the public name() getter.
Definition at line 224 of file test.h.
Referenced by test_node, micro_os_plus::micro_test_plus::detail::runnable< Self_T >::~runnable, micro_os_plus::micro_test_plus::detail::runnable_base::~runnable_base, ~test_node and name.
totals_
| protected |
Totals for the test node, including nested cases.
Definition at line 229 of file test.h.
Referenced by micro_os_plus::micro_test_plus::runner::exit_code, micro_os_plus::micro_test_plus::runner::run_suites_, micro_os_plus::micro_test_plus::static_runner::run_suites_, totals and totals.
The documentation for this class was generated from the following files:
Generated via doxygen2docusaurus 2.2.0 by Doxygen 1.17.0.