diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-11-07 15:39:07 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-11-07 15:44:31 +0100 |
commit | ed7aca86181fd597c5362a072954c9c93d5f55c1 (patch) | |
tree | db24ebafa134e427100e92527d60a38aa002b31c /spec | |
parent | 9ee3c014b65d3ed0cb13fa42365e72df1561e082 (diff) |
spec: Improve thread idle bodies test
Diffstat (limited to 'spec')
-rw-r--r-- | spec/score/thread/val/idle-body-no-return.yml | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/spec/score/thread/val/idle-body-no-return.yml b/spec/score/thread/val/idle-body-no-return.yml index 39820640..625743a5 100644 --- a/spec/score/thread/val/idle-body-no-return.yml +++ b/spec/score/thread/val/idle-body-no-return.yml @@ -56,19 +56,30 @@ test-support: | static void CheckIdleBody( Context *ctx, rtems_task_entry entry ) { - rtems_id id; + rtems_id id; + rtems_interval interval; + rtems_status_code sc; ctx->counter = 0; id = CreateTask( "WORK", PRIO_LOW ); StartTask( id, entry, ctx ); - while ( ctx->counter == 0 ) { - rtems_status_code sc; + /* + * With optimization disabled, coverage enabled, SMP enabled and a slow + * target, things may take some time. + */ + interval = 1; + while ( ctx->counter == 0 && interval <= 1024 ) { - sc = rtems_task_wake_after( 1 ); + sc = rtems_task_wake_after( interval ); T_rsc_success( sc ); + + interval *= 2; } + sc = rtems_task_wake_after( interval ); + T_rsc_success( sc ); + T_eq_u32( ctx->counter, 1 ); DeleteTask( id ); } |