summaryrefslogtreecommitdiffstats
path: root/spec/acfg/val/acfg.yml
blob: 7fe448882cf9711babb89565f8c8edd8c015a45e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
copyrights:
- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
enabled-by: true
links: []
test-actions:
- action-brief: |
    Check the effect of application configuration options.  In addition, this
    test case validates the effect of ${../if/init:/name}.  The test case
    includes ${../if/header-confdefs:/path} without defining
    ${../if/init:/name} before the include.  If this header would define
    configuration data structures, then linking the test suite executable would
    result in multiple definition errors.  This header is included in the test
    suite runner translation unit while ${../if/init:/name} is defined before
    the include.  If this would not result in the definition of application
    defined configuration data structures, then the checks below for
    non-default settings would fail.
  action-code: |
    rtems_status_code sc;
    rtems_id          id;
  checks:
  - brief: |
      Check the default value ${/acfg/if/idle-task-body:/name} where the
      optional BSP-provided default value is enabled.
    code: |
      T_eq_ptr(
        rtems_configuration_get_idle_task(),
      #if defined(BSP_IDLE_TASK_BODY)
        BSP_IDLE_TASK_BODY
      #else
        _CPU_Thread_Idle_body
      #endif
      );
    links:
    - role: validation
      uid: ../req/idle-task-body
    - role: validation
      uid: ../req/disable-bsp-settings
  - brief: |
      Check the configured ${/acfg/if/init-task-arguments:/name}.  This
      validates also the effect of ${/acfg/if/init-task-entrypoint:/name} and
      ${/acfg/if/rtems-init-tasks-table:/name}.
    code: |
      T_eq_ulong( test_runner_argument, TEST_RUNNER_ARGUMENT );
    links:
    - role: validation
      uid: ../req/init-task-arguments
    - role: validation
      uid: ../req/init-task-entrypoint
    - role: validation
      uid: ../req/rtems-init-tasks-table
  - brief: |
      Check the configured ${/acfg/if/init-task-initial-modes:/name}.
    code: |
      T_eq_u32( test_runner_initial_modes, TEST_RUNNER_INITIAL_MODES );
    links:
    - role: validation
      uid: ../req/init-task-initial-modes
  - brief: |
      Check the configured ${/acfg/if/init-task-name:/name}.
    code: |
      sc = rtems_task_ident( TEST_RUNNER_NAME, RTEMS_SEARCH_LOCAL_NODE, &id );
      T_rsc_success( sc );
      T_eq_u32( id, rtems_task_self() );
    links:
    - role: validation
      uid: ../req/init-task-name
  - brief: |
      Check the configured ${/acfg/if/init-task-priority:/name}.  A priority of
      zero can only be set for system tasks.  This validates also
      ${/acfg/if/init-task-attributes:/name}.
    code: |
      T_eq_u32( test_runner_initial_priority, 0 );
    links:
    - role: validation
      uid: ../req/init-task-priority
    - role: validation
      uid: ../req/init-task-attributes
  - brief: |
      Check that the configured
      ${/acfg/if/min-tasks-with-user-provided-storage:/name} value reduced the
      stack space size.
    code: |
      T_eq_uptr(
        _Stack_Space_size,
        RTEMS_ALIGN_UP( HEAP_BLOCK_HEADER_SIZE, CPU_HEAP_ALIGNMENT )
      );
    links:
    - role: validation
      uid: ../req/min-tasks-with-user-provided-storage
  - brief: |
      Check the configured ${/acfg/if/max-barriers:/name} value.
    code: |
      T_eq_u32(
        rtems_configuration_get_maximum_barriers(),
        TEST_MAXIMUM_BARRIERS
      );
    links:
    - role: validation
      uid: ../req/max-barriers
    - role: validation
      uid: /rtems/config/req/get-maximum-barriers
  - brief: |
      Check the configured ${/acfg/if/max-user-extensions:/name} value.
    code: |
      T_eq_u32(
        rtems_configuration_get_maximum_extensions(),
        TEST_MAXIMUM_USER_EXTENSIONS
      );
    links:
    - role: validation
      uid: ../req/max-user-extensions
    - role: validation
      uid: /rtems/config/req/get-maximum-extensions
  - brief: |
      Check the configured ${/acfg/if/max-message-queues:/name} value.
    code: |
      T_eq_u32(
        rtems_configuration_get_maximum_message_queues(),
        TEST_MAXIMUM_MESSAGE_QUEUES
      );
    links:
    - role: validation
      uid: ../req/max-message-queues
    - role: validation
      uid: /rtems/config/req/get-maximum-message-queues
  - brief: |
      Check the configured ${/acfg/if/max-partitions:/name} value.
    code: |
      T_eq_u32(
        rtems_configuration_get_maximum_partitions(),
        TEST_MAXIMUM_PARTITIONS
      );
    links:
    - role: validation
      uid: ../req/max-partitions
    - role: validation
      uid: /rtems/config/req/get-maximum-partitions
  - brief: |
      Check the configured ${/acfg/if/max-periods:/name} value.
    code: |
      T_eq_u32(
        rtems_configuration_get_maximum_periods(),
        TEST_MAXIMUM_PERIODS
      );
    links:
    - role: validation
      uid: ../req/max-periods
    - role: validation
      uid: /rtems/config/req/get-maximum-periods
  - brief: |
      Check the default ${/acfg/if/max-ports:/name} value.
    code: |
      T_eq_u32(
        rtems_configuration_get_maximum_ports(),
        0
      );
    links:
    - role: validation
      uid: /rtems/config/req/get-maximum-ports
  - brief: |
      Check the configured ${/acfg/if/max-processors:/name} value.
    code: |
      T_eq_u32(
        rtems_configuration_get_maximum_processors(),
      #if defined(RTEMS_SMP)
        5
      #else
        1
      #endif
      );
    links:
    - role: validation
      uid: ../req/max-processors
    - role: validation
      uid: /rtems/config/req/get-maximum-processors
  - brief: |
      Check the default ${/acfg/if/max-regions:/name} value.
    code: |
      T_eq_u32(
        rtems_configuration_get_maximum_regions(),
        0
      );
    links:
    - role: validation
      uid: /rtems/config/req/get-maximum-regions
  - brief: |
      Check the configured ${/acfg/if/max-semaphores:/name} value.
    code: |
      T_eq_u32(
        rtems_configuration_get_maximum_semaphores(),
        TEST_MAXIMUM_SEMAPHORES
      );
    links:
    - role: validation
      uid: ../req/max-semaphores
    - role: validation
      uid: /rtems/config/req/get-maximum-semaphores
  - brief: |
      Check the configured ${/acfg/if/max-tasks:/name} value.
    code: |
      T_eq_u32(
        rtems_configuration_get_maximum_tasks(),
        TEST_MAXIMUM_TASKS
      );
    links:
    - role: validation
      uid: ../req/max-tasks
    - role: validation
      uid: /rtems/config/req/get-maximum-tasks
  - brief: |
      Check the configured ${/acfg/if/max-timers:/name} value.
    code: |
      T_eq_u32(
        rtems_configuration_get_maximum_timers(),
        TEST_MAXIMUM_TIMERS
      );
    links:
    - role: validation
      uid: ../req/max-timers
    - role: validation
      uid: /rtems/config/req/get-maximum-timers
  - brief: |
      Check the configured ${/acfg/if/microseconds-per-tick:/name} value in
      microseconds.
    code: |
      T_eq_u32(
        rtems_configuration_get_microseconds_per_tick(),
        TEST_MICROSECONDS_PER_TICK
      );
    links:
    - role: validation
      uid: ../req/microseconds-per-tick
    - role: validation
      uid: /rtems/config/req/get-microseconds-per-tick
  - brief: |
      Check the configured ${/acfg/if/microseconds-per-tick:/name} value in
      milliseconds.
    code: |
      T_eq_u32(
        rtems_configuration_get_milliseconds_per_tick(),
        TEST_MICROSECONDS_PER_TICK / 1000
      );
    links:
    - role: validation
      uid: ../req/microseconds-per-tick
    - role: validation
      uid: /rtems/config/req/get-milliseconds-per-tick
  - brief: |
      Check the configured ${/acfg/if/microseconds-per-tick:/name} value in
      nanoseconds.
    code: |
      T_eq_u32(
        rtems_configuration_get_nanoseconds_per_tick(),
        TEST_MICROSECONDS_PER_TICK * 1000
      );
    links:
    - role: validation
      uid: ../req/microseconds-per-tick
    - role: validation
      uid: /rtems/config/req/get-nanoseconds-per-tick
  - brief: |
      Check the configured ${/acfg/if/task-stack-allocator:/name} hook.  Using
      the test stack allocator validates also
      ${/acfg/if/init-task-construct-storage-size:/spec}, since the
      test_task_stack_allocate() allocate handler only supports
      ${/acfg/if/max-tasks:/name} minus one stacks and the validation test for
      ${/rtems/task/req/create-errors:/spec} creates for some pre-condition variants
      all tasks until ${/rtems/status/if/too-many:/name} is returned.  In
      addition, test_task_stack_allocate() checks that the allocation size is
      greater than or equal to TEST_MINIMUM_STACK_SIZE which validates
      ${/acfg/if/min-task-stack-size:/name}.
    code: |
      T_eq_ptr(
        rtems_configuration_get_stack_allocate_hook(),
        test_task_stack_allocate
      );
    links:
    - role: validation
      uid: ../req/task-stack-allocator
    - role: validation
      uid: ../req/init-task-construct-storage-size
    - role: validation
      uid: ../req/min-task-stack-size
    - role: validation
      uid: /rtems/config/req/get-stack-allocate-hook
  - brief: |
      Check the configured ${/acfg/if/task-stack-no-workspace:/name} value.
    code: |
      T_true( rtems_configuration_get_stack_allocator_avoids_work_space() );
    links:
    - role: validation
      uid: ../req/task-stack-no-workspace
    - role: validation
      uid: /rtems/config/req/get-stack-allocator-avoids-work-space
  - brief: |
      Check the configured ${/acfg/if/task-stack-deallocator:/name} hook.
    code: |
      T_eq_ptr(
        rtems_configuration_get_stack_free_hook(),
        test_task_stack_deallocate
      );
    links:
    - role: validation
      uid: ../req/task-stack-deallocator
    - role: validation
      uid: /rtems/config/req/get-stack-free-hook
  - brief: |
      Check the configured ${/acfg/if/task-stack-allocator-for-idle:/name} hook.
    code: |
      T_eq_ptr(
        rtems_configuration_get_stack_allocate_for_idle_hook(),
        test_idle_task_stack_allocate
      );
    links:
    - role: validation
      uid: ../req/task-stack-allocator-for-idle
    - role: validation
      uid: /rtems/config/req/get-stack-allocate-for-idle-hook
  - brief: |
      Check the configured ${/acfg/if/idle-task-stack-size:/name} value.
    code: |
      T_eq_sz(
        rtems_configuration_get_idle_task_stack_size(),
        TEST_IDLE_STACK_SIZE
      );
    links:
    - role: validation
      uid: ../req/idle-task-stack-size
    - role: validation
      uid: /rtems/config/req/get-idle-task-stack-size
  - brief: |
      Check the configured ${/acfg/if/interrupt-stack-size:/name} value.
    code: |
      T_eq_sz(
        rtems_configuration_get_interrupt_stack_size(),
        TEST_INTERRUPT_STACK_SIZE
      );
    links:
    - role: validation
      uid: ../req/interrupt-stack-size
    - role: validation
      uid: /rtems/config/req/get-interrupt-stack-size
  - brief: |
      Check the configured ${/acfg/if/ticks-per-time-slice:/name} value.
    code: |
      T_eq_u32(
        rtems_configuration_get_ticks_per_timeslice(),
        TEST_TICKS_PER_TIMESLICE
      );
    links:
    - role: validation
      uid: ../req/ticks-per-time-slice
    - role: validation
      uid: /rtems/config/req/get-ticks-per-timeslice
  links:
  - role: validation
    uid: ../req/init
test-brief: |
  Tests the effect of application configuration options.
test-context: []
test-context-support: null
test-description: null
test-header: null
test-includes:
- bsp.h
- rtems/confdefs.h
- rtems/score/heap.h
test-local-includes:
- ts-config.h
- tx-support.h
test-setup: null
test-stop: null
test-support: null
test-target: testsuites/validation/tc-acfg.c
test-teardown: null
type: test-case