summaryrefslogtreecommitdiffstats
path: root/spec/acfg/val/appl-needs-clock-driver.yml
blob: 34fe9c993a9d4026b46ba2c7ac0da3a86cee591f (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
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
copyrights:
- Copyright (C) 2022 embedded brains GmbH (http://www.embedded-brains.de)
enabled-by: true
links: []
test-actions:
- action-brief: |
    Get the current clock ticks since boot value. Busy wait for at least one
    clock tick interval.
  action-code: |
    T_time  time_per_clock_tick;
    T_ticks duration;
    T_ticks elapsed;
    T_ticks t0;
    T_ticks t1;
    rtems_interval ticks_since_boot;

    ticks_since_boot = rtems_clock_get_ticks_since_boot();

    time_per_clock_tick = T_seconds_and_nanoseconds_to_time(
      0,
      rtems_configuration_get_nanoseconds_per_tick()
    );
    duration = 2 * T_time_to_ticks( time_per_clock_tick );
    elapsed = 0;
    t0 = T_tick();

    while ( elapsed < duration ) {
      t1 = T_tick();
      elapsed += t1 - t0;
      t0 = t1;
    }
  checks:
  - brief: |
      Check that the clock ticks since boot count changed while busy waiting
      for more than one clock tick interval.
    code: |
      T_step_gt_u32(
        ${.:/step},
        rtems_clock_get_ticks_since_boot() - ticks_since_boot,
        0
      );
    links:
    - role: validation
      uid: ../req/appl-needs-clock-driver
  links: []
test-brief: |
  Tests the effect of the ${../if/appl-needs-clock-driver:/name} application
  configuration option.
test-context: []
test-context-support: null
test-description: null
test-header: null
test-includes:
- rtems.h
test-local-includes: []
test-setup: null
test-stop: null
test-support: null
test-target: testsuites/validation/tc-acfg-appl-needs-clock-driver.c
test-teardown: null
type: test-case