|
micro-test-plus 4.1.0
µTest++ Testing Framework
|
Aggregated pass/fail/subtest counters for a node in the test tree. More...
#include <micro-os-plus/micro-test-plus.h>
Public Member Functions | |
| runner_totals ()=default | |
| Default constructor. All counters are zero-initialised. | |
| runner_totals (const runner_totals &)=delete | |
| Deleted copy constructor to prevent copying. | |
| runner_totals (runner_totals &&)=delete | |
| Deleted move constructor to prevent moving. | |
| size_t | executed_checks () const noexcept |
| Returns the total number of checks executed. | |
| size_t | executed_subtests () const noexcept |
| Returns the number of subtests that were executed. | |
| size_t | failed_checks () const noexcept |
| Returns the number of checks that failed. | |
| void | increment_executed_subtests (size_t count=1) noexcept |
| Increments the executed-subtests counter. | |
| void | increment_failed_checks (size_t count=1) noexcept |
| Increments the failed-checks counter. | |
| void | increment_successful_checks (size_t count=1) noexcept |
| Increments the successful-checks counter. | |
| runner_totals & | operator+= (const runner_totals &other) noexcept |
| Accumulates the totals from another instance into this one. | |
| runner_totals & | operator= (const runner_totals &)=delete |
| Deleted copy assignment operator to prevent copying. | |
| runner_totals & | operator= (runner_totals &&)=delete |
| Deleted move assignment operator to prevent moving. | |
| size_t | successful_checks () const noexcept |
| Returns the number of checks that passed. | |
| bool | was_successful (void) const noexcept |
| Checks whether all executed checks were successful. | |
Protected Attributes | |
| size_t | executed_subtests_ = 0 |
| Total number of tests executed. | |
| size_t | failed_checks_ = 0 |
| Total number of failed checks. | |
| size_t | successful_checks_ = 0 |
| Total number of successful checks. | |
runner_totals records three counters that are maintained throughout a test session:
Every test_node-derived object (runner, suite, subtest) owns a runner_totals member and accumulates its counts in place. At the end of each suite or session the operator += propagates the child totals up to the parent node.
The class is non-copyable and non-movable to prevent accidental duplication of live counters.
Definition at line 88 of file runner-totals.h.
|
default |
Referenced by runner_totals(), runner_totals(), operator+=(), operator=(), and operator=().
|
delete |
References runner_totals().
|
delete |
References runner_totals().
|
inlinenodiscardnoexcept |
Returns the sum of successful_checks_ and failed_checks_.
Definition at line 111 of file runner-totals-inlines.h.
References failed_checks_, and successful_checks_.
Referenced by micro_os_plus::micro_test_plus::reporter_tap::end_subtest(), micro_os_plus::micro_test_plus::reporter_tap::end_suite(), and operator=().
|
inlinenodiscardnoexcept |
Returns the value of the executed_subtests_ counter.
Definition at line 121 of file runner-totals-inlines.h.
References executed_subtests_.
Referenced by 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_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=().
|
inlinenodiscardnoexcept |
Returns the value of the failed_checks_ counter.
Definition at line 101 of file runner-totals-inlines.h.
References failed_checks_.
Referenced by 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=().
|
inlinenoexcept |
| count | The number of subtests to add (default 1). |
Adds count to the executed_subtests_ counter.
Definition at line 81 of file runner-totals-inlines.h.
References executed_subtests_.
Referenced by micro_os_plus::micro_test_plus::detail::runnable_base::after_subtest_create_(), and operator=().
|
inlinenoexcept |
| count | The number of failed checks to add (default 1). |
Adds count to the failed_checks_ counter.
Definition at line 71 of file runner-totals-inlines.h.
References failed_checks_.
Referenced by operator=().
|
inlinenoexcept |
| count | The number of successful checks to add (default 1). |
Adds count to the successful_checks_ counter.
Definition at line 61 of file runner-totals-inlines.h.
References successful_checks_.
|
noexcept |
| other | The instance whose totals are to be added. |
Adds the successful check count, failed check count, and executed subtest count of other to the corresponding members of this instance. Returns a reference to *this to support chaining. When tracing is enabled, the updated totals are output for diagnostic purposes.
Definition at line 71 of file runner-totals.cpp.
References runner_totals(), executed_subtests_, failed_checks_, and successful_checks_.
|
delete |
References runner_totals().
|
delete |
|
inlinenodiscardnoexcept |
Returns the value of the successful_checks_ counter.
Definition at line 91 of file runner-totals-inlines.h.
References successful_checks_.
Referenced by 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=().
|
inlinenodiscardnoexcept |
| true | No checks failed. |
| false | At least one check failed. |
A runner with no checks at all is considered successful, as it did not fail any check.
Definition at line 132 of file runner-totals-inlines.h.
References failed_checks_.
Referenced by micro_os_plus::micro_test_plus::reporter_human::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 runner-totals.h.
Referenced by executed_subtests(), increment_executed_subtests(), and operator+=().
|
protected |
Definition at line 219 of file runner-totals.h.
Referenced by executed_checks(), failed_checks(), increment_failed_checks(), operator+=(), and was_successful().
|
protected |
Definition at line 214 of file runner-totals.h.
Referenced by executed_checks(), increment_successful_checks(), operator+=(), and successful_checks().