25 #include "utest/utest_shim.h" 26 #include "SingletonPtr.h" 38 REPEAT_ON_TIMEOUT = 2,
39 REPEAT_ON_VALIDATE = 4,
41 REPEAT_SETUP_TEARDOWN = 16,
43 REPEAT_MASK = REPEAT_ON_TIMEOUT | REPEAT_ON_VALIDATE | REPEAT_CASE_ONLY | REPEAT_SETUP_TEARDOWN,
101 location = obj.location;
138 repeat_t inline get_repeat()
const {
141 uint32_t
inline get_timeout()
const {
185 base_control_t(make_base_control_t(REPEAT_UNDECLR, timeout_ms)) {}
193 (rhs.timeout ==
TIMEOUT_NONE) ? rhs.timeout : lhs.timeout);
195 if (result.timeout !=
TIMEOUT_NONE && result.timeout > rhs.timeout) {
196 result.timeout = rhs.timeout;
203 if (result.repeat & REPEAT_SETUP_TEARDOWN) {
204 result.repeat =
repeat_t(result.repeat & ~REPEAT_CASE_ONLY);
206 if (result.timeout ==
TIMEOUT_NONE && result.repeat & REPEAT_ON_TIMEOUT) {
207 result.repeat =
repeat_t(result.repeat & ~REPEAT_ON_TIMEOUT);
215 inline get_repeat()
const {
219 inline get_timeout()
const {
390 __deprecated_message(
"Use CaseRepeatAll instead.")
393 __deprecated_message("Use CaseRepeatHandler instead.")
410 #endif // UTEST_TYPES_H
A failure occurred in the case setup.
Control class for specifying test case attributes.
const base_control_t CaseAwait
Awaits until the callback is validated and never times out. Use with caution!
const char * stringify(utest::v1::status_t status)
Stringifies a status.
repeat only the handler on timeout
const base_control_t CaseNext
does not repeat this test case and immediately moves on to the next one without timeout ...
A failure occurred in the test setup.
const base_control_t CaseNoRepeat
does not repeat this test case, moves on to the next one
An unknown failure occurred.
A failure occurred in an unknown location.
A failure occurred in at least one test case.
POD version of the class control_t.
utest::v1::status_t(* case_setup_handler_t)(const Case *const source, const size_t index_of_case)
Test case setup handler.
const base_control_t CaseNoTimeout
No timeout, immediately moves on to the next case, but allows repeats.
const base_control_t CaseRepeatAll
repeats the test case handler with calling teardown and setup handlers
repeat the handler with setup and teardown
utest::v1::status_t(* case_teardown_handler_t)(const Case *const source, const size_t passed, const size_t failed, const failure_t reason)
Test case teardown handler.
A failure occurred in the test teardown.
control_t CaseTimeout(uint32_t ms)
Alias class for asynchronous timeout control in milliseconds.
Contains the reason and location of the failure.
utest::v1::status_t(* test_setup_handler_t)(const size_t number_of_cases)
Test setup handler.
continue with the next test case
void(* test_teardown_handler_t)(const size_t passed, const size_t failed, const failure_t failure)
Test teardown handler.
A failure occurred in the case handler.
control_t CaseRepeatAllOnTimeout(uint32_t ms)
Alias class for asynchronous timeout control in milliseconds and repeats the test case handler with c...
control_t operator+(const control_t &lhs, const base_control_t &rhs)
Timeout not explicitly specified, defaults to NONE.
A failure occurred in the case teardown.
void(* test_failure_handler_t)(const failure_t reason)
Test failure handler.
failure_reason_t
failure_reason_t
failure_t ignored() const
ignores failure and continues testing
The test case contains only empty handlers.
void(* case_handler_t)(void)
Primitive test case handler.
An expected asynchronous call timed out.
failure_t(const failure_t &obj)
Copy constructor.
utest::v1::status_t(* case_failure_handler_t)(const Case *const source, const failure_t reason)
Test case failure handler.
control_t(* case_call_count_handler_t)(const size_t call_count)
Test case handler (repeatable)
const base_control_t CaseRepeatHandler
repeats only the test case handler without calling teardown and setup handlers
control_t CaseRepeatHandlerOnTimeout(uint32_t ms)
Alias class for asynchronous timeout control in milliseconds and repeats only the test case handler w...
control_t(* case_control_handler_t)(void)
Complex test case handler.
Asynchronous callback scheduling failed.
repeat the handler with setup and teardown on timeout
The failure may be ignored.