Skip to content

Commit

Permalink
[nrf fromtree] samples: basic: blinky_pwm: add testing base on consol…
Browse files Browse the repository at this point in the history
…e output

Extend automated testing on HW by veryfing console output.

Signed-off-by: Piotr Kosycarz <[email protected]>
(cherry picked from commit c9c9c97)
  • Loading branch information
nordic-piks authored and anangl committed Jun 14, 2024
1 parent 0cadaf1 commit 34773c0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion samples/basic/blinky_pwm/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,13 @@ tests:
- drivers
- pwm
depends_on: pwm
harness: led
harness: console
harness_config:
type: multi_line
ordered: true
regex:
- "PWM-based blinky"
- "Calibrating for channel [0-9]+"
- "Done calibrating; maximum/minimum periods [0-9]+/[0-9]+ nsec"
- "Using period [0-9]+"
- "Using period [0-9]+"
1 change: 1 addition & 0 deletions samples/basic/blinky_pwm/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ int main(void)
printk("Error %d: failed to set pulse width\n", ret);
return 0;
}
printk("Using period %d\n", period);

period = dir ? (period * 2U) : (period / 2U);
if (period > max_period) {
Expand Down

0 comments on commit 34773c0

Please sign in to comment.