@@ -675,7 +675,7 @@ static int z_ztest_run_test_suite_ptr(struct ztest_suite_node *suite)
675
675
int fail = 0 ;
676
676
int tc_result = TC_PASS ;
677
677
678
- if (test_status != ZTEST_STATUS_OK ) {
678
+ if (test_status < 0 ) {
679
679
return test_status ;
680
680
}
681
681
@@ -766,7 +766,7 @@ static int z_ztest_run_test_suite_ptr(struct ztest_suite_node *suite)
766
766
}
767
767
#endif
768
768
769
- if (test_status == ZTEST_STATUS_OK && fail != 0 && FAIL_FAST ) {
769
+ if (test_status == ZTEST_STATUS_OK && fail != 0 ) {
770
770
test_status = ZTEST_STATUS_HAS_FAILURE ;
771
771
}
772
772
}
@@ -882,28 +882,15 @@ static void __ztest_show_suite_summary_verbose(struct ztest_suite_node *suite)
882
882
tc_result = TC_SKIP ;
883
883
} else if (test -> stats -> pass_count == test -> stats -> run_count ) {
884
884
tc_result = TC_PASS ;
885
- } else if (test -> stats -> pass_count == 0 ) {
886
- tc_result = TC_FAIL ;
887
885
} else {
888
- tc_result = TC_FLAKY ;
886
+ tc_result = TC_FAIL ;
889
887
}
890
888
891
- if (tc_result == TC_FLAKY ) {
892
- TC_SUMMARY_PRINT (" - %s - [%s.%s] - (Failed %d of %d attempts)"
893
- " - duration = %u.%03u seconds\n" ,
894
- TC_RESULT_TO_STR (tc_result ),
895
- test -> test_suite_name , test -> name ,
896
- test -> stats -> run_count - test -> stats -> pass_count ,
897
- test -> stats -> run_count ,
898
- test -> stats -> duration_worst_ms / 1000 ,
899
- test -> stats -> duration_worst_ms % 1000 );
900
- } else {
901
- TC_SUMMARY_PRINT (" - %s - [%s.%s] duration = %u.%03u seconds\n" ,
902
- TC_RESULT_TO_STR (tc_result ),
903
- test -> test_suite_name , test -> name ,
904
- test -> stats -> duration_worst_ms / 1000 ,
905
- test -> stats -> duration_worst_ms % 1000 );
906
- }
889
+ TC_SUMMARY_PRINT (" - %s - [%s.%s] duration = %u.%03u seconds\n" ,
890
+ TC_RESULT_TO_STR (tc_result ),
891
+ test -> test_suite_name , test -> name ,
892
+ test -> stats -> duration_worst_ms / 1000 ,
893
+ test -> stats -> duration_worst_ms % 1000 );
907
894
908
895
if (flush_frequency % 3 == 0 ) {
909
896
/** Reduce the flush frequencey a bit to speed up the output */
@@ -943,6 +930,7 @@ static int __ztest_run_test_suite(struct ztest_suite_node *ptr, const void *stat
943
930
944
931
for (int i = 0 ; i < NUM_ITER_PER_SUITE ; i ++ ) {
945
932
if (ztest_api .should_suite_run (state , ptr )) {
933
+ __ztest_init_unit_test_result_for_suite (ptr );
946
934
int fail = z_ztest_run_test_suite_ptr (ptr );
947
935
948
936
count ++ ;
@@ -970,9 +958,6 @@ int z_impl_ztest_run_test_suites(const void *state)
970
958
memset (suites_to_run , 0 , ZTEST_SUITE_COUNT * sizeof (struct ztest_suite_node * ));
971
959
z_ztest_shuffle ((void * * )suites_to_run , (intptr_t )_ztest_suite_node_list_start ,
972
960
ZTEST_SUITE_COUNT , sizeof (struct ztest_suite_node ));
973
- for (size_t i = 0 ; i < ZTEST_SUITE_COUNT ; ++ i ) {
974
- __ztest_init_unit_test_result_for_suite (suites_to_run [i ]);
975
- }
976
961
for (size_t i = 0 ; i < ZTEST_SUITE_COUNT ; ++ i ) {
977
962
count += __ztest_run_test_suite (suites_to_run [i ], state );
978
963
/* Stop running tests if we have a critical error or if we have a failure and
@@ -986,7 +971,6 @@ int z_impl_ztest_run_test_suites(const void *state)
986
971
#else
987
972
for (struct ztest_suite_node * ptr = _ztest_suite_node_list_start ;
988
973
ptr < _ztest_suite_node_list_end ; ++ ptr ) {
989
- __ztest_init_unit_test_result_for_suite (ptr );
990
974
count += __ztest_run_test_suite (ptr , state );
991
975
/* Stop running tests if we have a critical error or if we have a failure and
992
976
* FAIL_FAST was set
0 commit comments