samples: tests: Fix usb.audio.headphones_microphone test
The sample was failing twister test with a timeout because there was no pass/fail criteria for it (nothing was tested). The fix adds harness on consolse and some output that can be verified. Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
This commit is contained in:
parent
09fea5cc5e
commit
ce776f0c7e
|
@ -5,3 +5,12 @@ tests:
|
|||
depends_on: usb_device
|
||||
tags: usb
|
||||
platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp
|
||||
harness: console
|
||||
harness_config:
|
||||
type: multi_line
|
||||
ordered: true
|
||||
regex:
|
||||
- "Entered main"
|
||||
- "Found USB Headphones Device"
|
||||
- "Found USB Microphone Device"
|
||||
- "USB enabled"
|
||||
|
|
|
@ -76,11 +76,15 @@ void main(void)
|
|||
return;
|
||||
}
|
||||
|
||||
LOG_INF("Found USB Headphones Device");
|
||||
|
||||
if (!mic_dev) {
|
||||
LOG_ERR("Can not get USB Microphone Device");
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_INF("Found USB Microphone Device");
|
||||
|
||||
usb_audio_register(hp_dev, &hp_ops);
|
||||
|
||||
usb_audio_register(mic_dev, &mic_ops);
|
||||
|
@ -90,4 +94,6 @@ void main(void)
|
|||
LOG_ERR("Failed to enable USB");
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_INF("USB enabled");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue