ztest: unittest: Add before/after phase

Add missing setters for the before/after phase when running without
KERNEL.

Signed-off-by: Yuval Peress <peress@google.com>
This commit is contained in:
Yuval Peress 2022-08-09 22:08:26 -06:00 committed by Carles Cufí
commit 2a110cc473

View file

@ -330,6 +330,7 @@ static int run_test(struct ztest_suite_node *suite, struct ztest_unit_test *test
int ret = TC_PASS;
TC_START(test->name);
phase = TEST_PHASE_BEFORE;
if (test_result == ZTEST_RESULT_SUITE_FAIL) {
ret = TC_FAIL;
@ -358,6 +359,7 @@ static int run_test(struct ztest_suite_node *suite, struct ztest_unit_test *test
run_test_functions(suite, test, data);
out:
ret |= cleanup_test(test);
phase = TEST_PHASE_AFTER;
if (test_result != ZTEST_RESULT_SUITE_FAIL) {
if (suite->after != NULL) {
suite->after(data);