samples: basic: blinky_pwm: add testing base on console output

Extend automated testing on HW by veryfing console output.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
This commit is contained in:
Piotr Kosycarz 2024-05-14 12:47:12 +02:00 committed by Alberto Escolar
commit c9c9c9797f
2 changed files with 11 additions and 1 deletions

View file

@ -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]+"

View file

@ -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) {