Skip to content

Commit 175abfb

Browse files
aescolarfabiobaltieri
authored andcommitted
nrf52_bsim: Give better description on test not yet passed
When a bs_test is stopped before it passes, the current description is not informative enough. Improve it. Signed-off-by: Alberto Escolar Piedras <[email protected]>
1 parent 1753756 commit 175abfb

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

boards/posix/nrf52_bsim/bstests_entry.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,5 +233,13 @@ uint8_t bst_delete(void)
233233
test_list_top = tmp;
234234
}
235235

236+
if (bst_result == In_progress) {
237+
bs_trace_raw_time(2, "TESTCASE NOT PASSED at exit (test return "
238+
"(%u) indicates it was still in progress)\n", bst_result);
239+
} else if (bst_result != Passed) {
240+
bs_trace_raw_time(2, "The TESTCASE FAILED (test return code %u)\n",
241+
bst_result);
242+
}
243+
236244
return bst_result;
237245
}

boards/posix/nrf52_bsim/main.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ uint8_t inner_main_clean_up(int exit_code)
3939

4040
uint8_t bst_result = bst_delete();
4141

42-
if (bst_result != 0U) {
43-
bs_trace_raw_time(2, "main: The TESTCASE FAILED with return "
44-
"code %u\n", bst_result);
45-
}
4642
return BS_MAX(bst_result, max_exit_code);
4743
}
4844

0 commit comments

Comments
 (0)