|
micro-test-plus 4.1.0
µTest++ Testing Framework
|
Base class for runners and runable tests. More...
#include <micro-os-plus/micro-test-plus.h>
Public Member Functions | |
| test_node (const char *name) | |
| Constructs a test node. | |
| test_node (const test_node &)=delete | |
| Deleted copy constructor to prevent copying. | |
| test_node (test_node &&)=delete | |
| Deleted move constructor to prevent moving. | |
| virtual | ~test_node () |
| Virtual destructor for the test_node class. | |
| const char * | name (void) const noexcept |
| Gets the node name. | |
| test_node & | operator= (const test_node &)=delete |
| Deleted copy assignment operator to prevent copying. | |
| test_node & | operator= (test_node &&)=delete |
| Deleted move assignment operator to prevent moving. | |
| const runner_totals & | totals () const noexcept |
| Gets the totals for the test (const overload). | |
| runner_totals & | totals () noexcept |
| Gets the totals for the test. | |
Protected Attributes | |
| const char * | name_ |
| The test node name. | |
| runner_totals | totals_ |
| Totals for the test node, including nested cases. | |
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.
| micro_os_plus::micro_test_plus::detail::test_node::test_node | ( | const char * | name | ) |
| [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.
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=().
|
delete |
References test_node().
|
delete |
References test_node().
|
virtual |
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.
Definition at line 107 of file test.cpp.
References name_.
|
inlinenodiscardnoexcept |
Returns a pointer to the null-terminated name stored in name_.
Definition at line 91 of file test-inlines.h.
References 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().
|
delete |
References test_node().
References test_node(), and totals().
|
inlinenodiscardnoexcept |
Returns a const reference to the runner_totals member.
Definition at line 111 of file test-inlines.h.
References totals_.
|
inlinenodiscardnoexcept |
Returns a reference to the runner_totals member.
Definition at line 101 of file test-inlines.h.
References 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 |
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().
|
protected |
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().