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:
Maciej Perkowski 2021-02-10 15:03:44 +01:00 committed by Anas Nashif
parent 09fea5cc5e
commit ce776f0c7e
2 changed files with 15 additions and 0 deletions

View file

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

View file

@ -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");
}