mirror of https://github.com/ARMmbed/mbed-os.git
Move utest handlers out of critical section
In the function raise_failure move the test_failure and case_failure calls out of the critical section. This allows these handlers to run without interrupts disabled and enables them to use rtos features such as a mutex. This is required for heap metrics to work.pull/2442/head
parent
81859050c3
commit
f21adc4ad1
|
|
@ -167,11 +167,12 @@ void Harness::raise_failure(const failure_reason_t reason)
|
|||
if (test_cases == NULL) return;
|
||||
|
||||
utest::v1::status_t fail_status = STATUS_ABORT;
|
||||
if (handlers.test_failure) handlers.test_failure(failure_t(reason, location));
|
||||
if (handlers.case_failure) fail_status = handlers.case_failure(case_current, failure_t(reason, location));
|
||||
|
||||
{
|
||||
UTEST_ENTER_CRITICAL_SECTION;
|
||||
|
||||
if (handlers.test_failure) handlers.test_failure(failure_t(reason, location));
|
||||
if (handlers.case_failure) fail_status = handlers.case_failure(case_current, failure_t(reason, location));
|
||||
if (fail_status != STATUS_IGNORE) case_failed++;
|
||||
|
||||
if ((fail_status == STATUS_ABORT) && case_timeout_handle)
|
||||
|
|
|
|||
Loading…
Reference in New Issue