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:
parent
08db645d81
commit
2a110cc473
1 changed files with 2 additions and 0 deletions
|
@ -330,6 +330,7 @@ static int run_test(struct ztest_suite_node *suite, struct ztest_unit_test *test
|
||||||
int ret = TC_PASS;
|
int ret = TC_PASS;
|
||||||
|
|
||||||
TC_START(test->name);
|
TC_START(test->name);
|
||||||
|
phase = TEST_PHASE_BEFORE;
|
||||||
|
|
||||||
if (test_result == ZTEST_RESULT_SUITE_FAIL) {
|
if (test_result == ZTEST_RESULT_SUITE_FAIL) {
|
||||||
ret = TC_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);
|
run_test_functions(suite, test, data);
|
||||||
out:
|
out:
|
||||||
ret |= cleanup_test(test);
|
ret |= cleanup_test(test);
|
||||||
|
phase = TEST_PHASE_AFTER;
|
||||||
if (test_result != ZTEST_RESULT_SUITE_FAIL) {
|
if (test_result != ZTEST_RESULT_SUITE_FAIL) {
|
||||||
if (suite->after != NULL) {
|
if (suite->after != NULL) {
|
||||||
suite->after(data);
|
suite->after(data);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue