diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-02-04 08:16:58 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-02-04 14:23:23 +0100 |
commit | a4a93bef3fb98b4132f42a526a946a38712acf50 (patch) | |
tree | 066e60283c6746d6794801b93de21e8454373fd2 | |
parent | validation: Add context and fixture to test case (diff) | |
download | rtems-central-a4a93bef3fb98b4132f42a526a946a38712acf50.tar.bz2 |
spec: Avoid test prologue/epilogue in test cases
-rw-r--r-- | spec/rtems/attr/val/attr.yml | 5 | ||||
-rw-r--r-- | spec/rtems/barrier/val/ident.yml | 30 | ||||
-rw-r--r-- | spec/rtems/event/val/event-constant.yml | 7 | ||||
-rw-r--r-- | spec/rtems/event/val/events.yml | 7 | ||||
-rw-r--r-- | spec/rtems/message/val/ident.yml | 26 | ||||
-rw-r--r-- | spec/rtems/mode/val/modes.yml | 5 | ||||
-rw-r--r-- | spec/rtems/option/val/options.yml | 5 | ||||
-rw-r--r-- | spec/rtems/part/val/ident.yml | 36 | ||||
-rw-r--r-- | spec/rtems/part/val/part.yml | 15 | ||||
-rw-r--r-- | spec/rtems/ratemon/val/ident.yml | 26 | ||||
-rw-r--r-- | spec/rtems/sem/val/ident.yml | 32 | ||||
-rw-r--r-- | spec/rtems/timer/val/ident.yml | 26 | ||||
-rw-r--r-- | spec/rtems/userext/val/ident.yml | 30 | ||||
-rw-r--r-- | spec/testsuites/validation/c-library.yml | 9 | ||||
-rw-r--r-- | spec/testsuites/validation/classic-barrier.yml | 50 |
15 files changed, 172 insertions, 137 deletions
diff --git a/spec/rtems/attr/val/attr.yml b/spec/rtems/attr/val/attr.yml index 167948f3..d5601b9c 100644 --- a/spec/rtems/attr/val/attr.yml +++ b/spec/rtems/attr/val/attr.yml @@ -5,6 +5,8 @@ enabled-by: true links: [] test-actions: - action: | + rtems_attribute attributes; + /* No action */ checks: - check: | @@ -254,8 +256,7 @@ test-header: null test-includes: - rtems.h test-local-includes: [] -test-prologue: | - rtems_attribute attributes; +test-prologue: null test-setup: null test-stop: null test-support: | diff --git a/spec/rtems/barrier/val/ident.yml b/spec/rtems/barrier/val/ident.yml index 08f983e0..69cf0969 100644 --- a/spec/rtems/barrier/val/ident.yml +++ b/spec/rtems/barrier/val/ident.yml @@ -7,10 +7,24 @@ links: uid: ../req/ident test-actions: - action: | + rtems_status_code sc; + rtems_id id_local_object; + + sc = rtems_barrier_create( + ClassicObjectLocalIdentName, + RTEMS_DEFAULT_ATTRIBUTES, + 1, + &id_local_object + ); + T_assert_rsc_success( sc ); + ${../../req/ident-local:/test-run}( id_local_object, ClassicBarrierIdentAction ); + + sc = rtems_barrier_delete( id_local_object ); + T_rsc_success( sc ); checks: [] description: | Run the generic object identification tests for Classic API partition class @@ -20,24 +34,12 @@ test-brief: Test the ${../if/ident:/name} directive. test-context: [] test-context-support: null test-description: null -test-epilogue: | - sc = rtems_barrier_delete( id_local_object ); - T_rsc_success( sc ); +test-epilogue: null test-header: null test-includes: [] test-local-includes: - tr-object-ident-local.h -test-prologue: | - rtems_status_code sc; - rtems_id id_local_object; - - sc = rtems_barrier_create( - ClassicObjectLocalIdentName, - RTEMS_DEFAULT_ATTRIBUTES, - 1, - &id_local_object - ); - T_assert_rsc_success( sc ); +test-prologue: null test-setup: null test-stop: null test-support: | diff --git a/spec/rtems/event/val/event-constant.yml b/spec/rtems/event/val/event-constant.yml index e33fd76b..d06e698d 100644 --- a/spec/rtems/event/val/event-constant.yml +++ b/spec/rtems/event/val/event-constant.yml @@ -5,6 +5,9 @@ enabled-by: true links: [] test-actions: - action: | + rtems_status_code sc; + rtems_event_set out; + /* No action */ checks: - check: | @@ -384,9 +387,7 @@ test-includes: - rtems.h test-local-includes: - tr-event-constant.h -test-prologue: | - rtems_status_code sc; - rtems_event_set out; +test-prologue: null test-setup: null test-stop: null test-support: null diff --git a/spec/rtems/event/val/events.yml b/spec/rtems/event/val/events.yml index 4c2372f1..063b24e1 100644 --- a/spec/rtems/event/val/events.yml +++ b/spec/rtems/event/val/events.yml @@ -5,6 +5,9 @@ enabled-by: true links: [] test-actions: - action: | + rtems_event_set all; + int i; + for ( i = 0; i < 32; ++i ) { ${event-constant:/test-run}( events[ i ], i ); T_step( (unsigned int) i ); /* ${steps/32} */ @@ -55,9 +58,7 @@ test-includes: - rtems.h test-local-includes: - tr-event-constant.h -test-prologue: | - rtems_event_set all; - int i; +test-prologue: null test-setup: null test-stop: null test-support: | diff --git a/spec/rtems/message/val/ident.yml b/spec/rtems/message/val/ident.yml index 628f17f9..e3e9d9c8 100644 --- a/spec/rtems/message/val/ident.yml +++ b/spec/rtems/message/val/ident.yml @@ -7,10 +7,22 @@ links: uid: ../req/ident test-actions: - action: | + rtems_status_code sc; + rtems_id id_local_object; + + sc = rtems_message_queue_construct( + &ClassicObjectIdentConfig, + &id_local_object + ); + T_assert_rsc_success( sc ); + ${../../req/ident:/test-run}( id_local_object, ClassicMessageIdentAction ); + + sc = rtems_message_queue_delete( id_local_object ); + T_rsc_success( sc ); checks: [] description: | Run the generic object identification tests for Classic API message queue @@ -20,22 +32,12 @@ test-brief: Test the ${../if/ident:/name} directive. test-context: [] test-context-support: null test-description: null -test-epilogue: | - sc = rtems_message_queue_delete( id_local_object ); - T_rsc_success( sc ); +test-epilogue: null test-header: null test-includes: [] test-local-includes: - tr-object-ident.h -test-prologue: | - rtems_status_code sc; - rtems_id id_local_object; - - sc = rtems_message_queue_construct( - &ClassicObjectIdentConfig, - &id_local_object - ); - T_assert_rsc_success( sc ); +test-prologue: null test-setup: null test-stop: null test-support: | diff --git a/spec/rtems/mode/val/modes.yml b/spec/rtems/mode/val/modes.yml index b62a66bc..4f42cc66 100644 --- a/spec/rtems/mode/val/modes.yml +++ b/spec/rtems/mode/val/modes.yml @@ -5,6 +5,8 @@ enabled-by: true links: [] test-actions: - action: | + rtems_mode modes; + /* No action */ checks: - check: | @@ -218,8 +220,7 @@ test-header: null test-includes: - rtems.h test-local-includes: [] -test-prologue: | - rtems_mode modes; +test-prologue: null test-setup: null test-stop: null test-support: | diff --git a/spec/rtems/option/val/options.yml b/spec/rtems/option/val/options.yml index 0364dcce..5e2e1c50 100644 --- a/spec/rtems/option/val/options.yml +++ b/spec/rtems/option/val/options.yml @@ -5,6 +5,8 @@ enabled-by: true links: [] test-actions: - action: | + rtems_option options; + /* No action */ checks: - check: | @@ -93,8 +95,7 @@ test-header: null test-includes: - rtems.h test-local-includes: [] -test-prologue: | - rtems_option options; +test-prologue: null test-setup: null test-stop: null test-support: | diff --git a/spec/rtems/part/val/ident.yml b/spec/rtems/part/val/ident.yml index ba402387..0ab8344c 100644 --- a/spec/rtems/part/val/ident.yml +++ b/spec/rtems/part/val/ident.yml @@ -7,10 +7,27 @@ links: uid: ../req/ident test-actions: - action: | + static RTEMS_ALIGNED( RTEMS_PARTITION_ALIGNMENT ) long area[32]; + rtems_status_code sc; + rtems_id id_local_object; + + sc = rtems_partition_create( + ClassicObjectIdentName, + area, + sizeof( area ), + sizeof( area ), + RTEMS_DEFAULT_ATTRIBUTES, + &id_local_object + ); + T_assert_rsc_success( sc ); + ${../../req/ident:/test-run}( id_local_object, ClassicPartIdentAction ); + + sc = rtems_partition_delete( id_local_object ); + T_rsc_success( sc ); checks: [] description: | Run the generic object identification tests for Classic API partition class @@ -20,27 +37,12 @@ test-brief: Test the ${../if/ident:/name} directive. test-context: [] test-context-support: null test-description: null -test-epilogue: | - sc = rtems_partition_delete( id_local_object ); - T_rsc_success( sc ); +test-epilogue: null test-header: null test-includes: [] test-local-includes: - tr-object-ident.h -test-prologue: | - static long area[32]; - rtems_status_code sc; - rtems_id id_local_object; - - sc = rtems_partition_create( - ClassicObjectIdentName, - area, - sizeof( area ), - sizeof( area ), - RTEMS_DEFAULT_ATTRIBUTES, - &id_local_object - ); - T_assert_rsc_success( sc ); +test-prologue: null test-setup: null test-stop: null test-support: | diff --git a/spec/rtems/part/val/part.yml b/spec/rtems/part/val/part.yml index 43f1a718..f2514d27 100644 --- a/spec/rtems/part/val/part.yml +++ b/spec/rtems/part/val/part.yml @@ -5,6 +5,13 @@ enabled-by: true links: [] test-actions: - action: | + RTEMS_ALIGNED( RTEMS_PARTITION_ALIGNMENT ) uint8_t + buffers[ 4 ][ 2 * sizeof( void * ) ]; + void *pointers[ RTEMS_ARRAY_SIZE( buffers ) ]; + void *pointer; + rtems_status_code sc; + rtems_id id; + id = 0xffffffff; sc = rtems_partition_create( rtems_build_name( 'N', 'A', 'M', 'E' ), @@ -98,13 +105,7 @@ test-header: null test-includes: - rtems.h test-local-includes: [] -test-prologue: | - RTEMS_ALIGNED( RTEMS_PARTITION_ALIGNMENT ) uint8_t - buffers[ 4 ][ 2 * sizeof( void * ) ]; - void *pointers[ RTEMS_ARRAY_SIZE( buffers ) ]; - void *pointer; - rtems_status_code sc; - rtems_id id; +test-prologue: null test-setup: null test-stop: null test-support: null diff --git a/spec/rtems/ratemon/val/ident.yml b/spec/rtems/ratemon/val/ident.yml index 0abbfe06..2a6f49e2 100644 --- a/spec/rtems/ratemon/val/ident.yml +++ b/spec/rtems/ratemon/val/ident.yml @@ -7,10 +7,22 @@ links: uid: ../req/ident test-actions: - action: | + rtems_status_code sc; + rtems_id id_local_object; + + sc = rtems_rate_monotonic_create( + ClassicObjectLocalIdentName, + &id_local_object + ); + T_assert_rsc_success( sc ); + ${../../req/ident-local:/test-run}( id_local_object, ClassicRatemonIdentAction ); + + sc = rtems_rate_monotonic_delete( id_local_object ); + T_rsc_success( sc ); checks: [] description: | Run the generic object identification tests for Classic API rate monotonic @@ -20,22 +32,12 @@ test-brief: Test the ${../if/ident:/name} directive. test-context: [] test-context-support: null test-description: null -test-epilogue: | - sc = rtems_rate_monotonic_delete( id_local_object ); - T_rsc_success( sc ); +test-epilogue: null test-header: null test-includes: [] test-local-includes: - tr-object-ident-local.h -test-prologue: | - rtems_status_code sc; - rtems_id id_local_object; - - sc = rtems_rate_monotonic_create( - ClassicObjectLocalIdentName, - &id_local_object - ); - T_assert_rsc_success( sc ); +test-prologue: null test-setup: null test-stop: null test-support: | diff --git a/spec/rtems/sem/val/ident.yml b/spec/rtems/sem/val/ident.yml index ba40dfd9..7b03f3df 100644 --- a/spec/rtems/sem/val/ident.yml +++ b/spec/rtems/sem/val/ident.yml @@ -7,10 +7,25 @@ links: uid: ../req/ident test-actions: - action: | + rtems_status_code sc; + rtems_id id_local_object; + + sc = rtems_semaphore_create( + ClassicObjectIdentName, + 0, + RTEMS_DEFAULT_ATTRIBUTES, + 0, + &id_local_object + ); + T_assert_rsc_success( sc ); + ${../../req/ident:/test-run}( id_local_object, ClassicSemIdentAction ); + + sc = rtems_semaphore_delete( id_local_object ); + T_rsc_success( sc ); checks: [] description: | Run the generic object identification tests for Classic API semaphore class @@ -20,25 +35,12 @@ test-brief: Test the ${../if/ident:/name} directive. test-context: [] test-context-support: null test-description: null -test-epilogue: | - sc = rtems_semaphore_delete( id_local_object ); - T_rsc_success( sc ); +test-epilogue: null test-header: null test-includes: [] test-local-includes: - tr-object-ident.h -test-prologue: | - rtems_status_code sc; - rtems_id id_local_object; - - sc = rtems_semaphore_create( - ClassicObjectIdentName, - 0, - RTEMS_DEFAULT_ATTRIBUTES, - 0, - &id_local_object - ); - T_assert_rsc_success( sc ); +test-prologue: null test-setup: null test-stop: null test-support: | diff --git a/spec/rtems/timer/val/ident.yml b/spec/rtems/timer/val/ident.yml index 446e5dc9..d69ca34e 100644 --- a/spec/rtems/timer/val/ident.yml +++ b/spec/rtems/timer/val/ident.yml @@ -7,10 +7,22 @@ links: uid: ../req/ident test-actions: - action: | + rtems_status_code sc; + rtems_id id_local_object; + + sc = rtems_timer_create( + ClassicObjectLocalIdentName, + &id_local_object + ); + T_assert_rsc_success( sc ); + ${../../req/ident-local:/test-run}( id_local_object, ClassicTimerIdentAction ); + + sc = rtems_timer_delete( id_local_object ); + T_rsc_success( sc ); checks: [] description: | Run the generic object identification tests for Classic API timer class @@ -20,22 +32,12 @@ test-brief: Test the ${../if/ident:/name} directive. test-context: [] test-context-support: null test-description: null -test-epilogue: | - sc = rtems_timer_delete( id_local_object ); - T_rsc_success( sc ); +test-epilogue: null test-header: null test-includes: [] test-local-includes: - tr-object-ident-local.h -test-prologue: | - rtems_status_code sc; - rtems_id id_local_object; - - sc = rtems_timer_create( - ClassicObjectLocalIdentName, - &id_local_object - ); - T_assert_rsc_success( sc ); +test-prologue: null test-setup: null test-stop: null test-support: | diff --git a/spec/rtems/userext/val/ident.yml b/spec/rtems/userext/val/ident.yml index 03620bd6..99ac879d 100644 --- a/spec/rtems/userext/val/ident.yml +++ b/spec/rtems/userext/val/ident.yml @@ -7,10 +7,24 @@ links: uid: ../req/ident test-actions: - action: | + static const rtems_extensions_table table; + rtems_status_code sc; + rtems_id id_local_object; + + sc = rtems_extension_create( + ClassicObjectLocalIdentName, + &table, + &id_local_object + ); + T_assert_rsc_success( sc ); + ${../../req/ident-local:/test-run}( id_local_object, ClassicUserExtIdentAction ); + + sc = rtems_extension_delete( id_local_object ); + T_rsc_success( sc ); checks: [] description: | Run the generic object identification tests for Classic API user extension @@ -20,24 +34,12 @@ test-brief: Test the ${../if/ident:/name} directive. test-context: [] test-context-support: null test-description: null -test-epilogue: | - sc = rtems_extension_delete( id_local_object ); - T_rsc_success( sc ); +test-epilogue: null test-header: null test-includes: [] test-local-includes: - tr-object-ident-local.h -test-prologue: | - static const rtems_extensions_table table; - rtems_status_code sc; - rtems_id id_local_object; - - sc = rtems_extension_create( - ClassicObjectLocalIdentName, - &table, - &id_local_object - ); - T_assert_rsc_success( sc ); +test-prologue: null test-setup: null test-stop: null test-support: | diff --git a/spec/testsuites/validation/c-library.yml b/spec/testsuites/validation/c-library.yml index 72cc9884..5a0d41c6 100644 --- a/spec/testsuites/validation/c-library.yml +++ b/spec/testsuites/validation/c-library.yml @@ -5,6 +5,10 @@ enabled-by: true links: [] test-actions: - action: | + void *p; + int s; + int d; + p = aligned_alloc(128, 4); checks: - check: | @@ -70,10 +74,7 @@ test-includes: - stdlib.h - rtems/malloc.h test-local-includes: [] -test-prologue: | - void *p; - int s; - int d; +test-prologue: null test-setup: null test-stop: null test-support: null diff --git a/spec/testsuites/validation/classic-barrier.yml b/spec/testsuites/validation/classic-barrier.yml index e28795cb..e4fb939e 100644 --- a/spec/testsuites/validation/classic-barrier.yml +++ b/spec/testsuites/validation/classic-barrier.yml @@ -5,8 +5,17 @@ enabled-by: true links: [] test-actions: - action: | - id = 0xffffffff; - sc = rtems_barrier_create(name, RTEMS_BARRIER_AUTOMATIC_RELEASE, 1, &id); + rtems_status_code sc; + rtems_id id; + TestsuitesValidationClassicBarrier_Context *ctx = T_fixture_context(); + + ctx->id = 0xffffffff; + sc = rtems_barrier_create( + name, + RTEMS_BARRIER_AUTOMATIC_RELEASE, + 1, + &ctx->id + ); checks: - check: | T_step_rsc_success(${step}, sc); @@ -18,8 +27,8 @@ test-actions: release barrier object for one task. links: [] - action: | - id2 = 0xffffffff; - sc = rtems_barrier_ident(name, &id2); + id = 0xffffffff; + sc = rtems_barrier_ident(name, &id); checks: - check: | T_step_rsc_success(${step}, sc); @@ -27,7 +36,7 @@ test-actions: Check that the barrier identification by name was successful. links: [] - check: | - T_step_eq_u32(${step}, id, id2); + T_step_eq_u32(${step}, id, ctx->id); description: | Check that the second identifier is equal to the one returned by the barrier creation. @@ -37,8 +46,10 @@ test-actions: object by its name. links: [] - action: | + uint32_t released; + released = 1; - sc = rtems_barrier_release(id, &released); + sc = rtems_barrier_release(ctx->id, &released); checks: - check: | T_step_rsc_success(${step}, sc); @@ -54,7 +65,7 @@ test-actions: Set the count of released tasks to one and release the barrier. links: [] - action: | - sc = rtems_barrier_wait(id, RTEMS_NO_TIMEOUT); + sc = rtems_barrier_wait(ctx->id, RTEMS_NO_TIMEOUT); checks: - check: | T_step_rsc_success(${step}, sc); @@ -67,24 +78,27 @@ test-actions: test-brief: | This test case calls functions of the Barrier Manager which are included in the space profile. -test-context: [] +test-context: +- brief: null + description: null + member: | + rtems_id id test-context-support: null test-description: null -test-epilogue: | - T_check_rtems_barriers(T_EVENT_RUN_INITIALIZE_EARLY, T_case_name()); +test-epilogue: null test-header: null test-includes: - rtems.h test-local-includes: [] -test-prologue: | - static const rtems_name name = rtems_build_name('B', 'A', 'R', 'R'); - rtems_status_code sc; - rtems_id id; - rtems_id id2; - uint32_t released; +test-prologue: null test-setup: null test-stop: null -test-support: null +test-support: | + static const rtems_name name = rtems_build_name( 'B', 'A', 'R', 'R' ); test-target: testsuites/validation/tc-space-profile.c -test-teardown: null +test-teardown: + brief: null + code: | + T_check_rtems_barriers(T_EVENT_RUN_INITIALIZE_EARLY, T_case_name()); + description: null type: test-case |