ztest: Match cleanup ordering between unittest and normal tests
Tests with KERNEL enabled perform their cleanup logic after the suite's after and test rules are executed. Unittests should do the same. Signed-off-by: Yuval Peress <peress@google.com>
This commit is contained in:
parent
5ceba48473
commit
61fb681036
1 changed files with 2 additions and 2 deletions
|
@ -387,8 +387,6 @@ static int run_test(struct ztest_suite_node *suite, struct ztest_unit_test *test
|
|||
}
|
||||
run_test_functions(suite, test, data);
|
||||
out:
|
||||
phase = TEST_PHASE_FRAMEWORK;
|
||||
ret |= cleanup_test(test);
|
||||
phase = TEST_PHASE_AFTER;
|
||||
if (test_result != ZTEST_RESULT_SUITE_FAIL) {
|
||||
if (suite->after != NULL) {
|
||||
|
@ -396,6 +394,8 @@ out:
|
|||
}
|
||||
run_test_rules(/*is_before=*/false, test, data);
|
||||
}
|
||||
phase = TEST_PHASE_FRAMEWORK;
|
||||
ret |= cleanup_test(test);
|
||||
|
||||
ret = get_final_test_result(test, ret);
|
||||
Z_TC_END_RESULT(ret, test->name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue