boards: nrf_bsim: bst hooks: Call tests delete only once
bst_delete() is called from an ON_EXIT hook, which can be called several times if an exit hook itself fails and calls exit on its own. This is not what most tests destructors will expect, and they may do weird things in this case. So let's not call into it again. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
parent
67de8d58ec
commit
719c4f4036
1 changed files with 7 additions and 0 deletions
|
@ -224,6 +224,13 @@ void bst_main(void)
|
|||
*/
|
||||
uint8_t bst_delete(void)
|
||||
{
|
||||
static bool already_deleted;
|
||||
|
||||
if (already_deleted) {
|
||||
return bst_result;
|
||||
}
|
||||
already_deleted = true;
|
||||
|
||||
if (current_test && current_test->test_delete_f) {
|
||||
current_test->test_delete_f();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue