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
2 changed files with 15 additions and 0 deletions
|
@ -5,3 +5,12 @@ tests:
|
||||||
depends_on: usb_device
|
depends_on: usb_device
|
||||||
tags: usb
|
tags: usb
|
||||||
platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LOG_INF("Found USB Headphones Device");
|
||||||
|
|
||||||
if (!mic_dev) {
|
if (!mic_dev) {
|
||||||
LOG_ERR("Can not get USB Microphone Device");
|
LOG_ERR("Can not get USB Microphone Device");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LOG_INF("Found USB Microphone Device");
|
||||||
|
|
||||||
usb_audio_register(hp_dev, &hp_ops);
|
usb_audio_register(hp_dev, &hp_ops);
|
||||||
|
|
||||||
usb_audio_register(mic_dev, &mic_ops);
|
usb_audio_register(mic_dev, &mic_ops);
|
||||||
|
@ -90,4 +94,6 @@ void main(void)
|
||||||
LOG_ERR("Failed to enable USB");
|
LOG_ERR("Failed to enable USB");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LOG_INF("USB enabled");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue