Skip to content

Commit 0fb5873

Browse files
PerMacnashif
authored andcommitted
samples: tests: Fix usb.audio.headset 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 <[email protected]>
1 parent ce776f0 commit 0fb5873

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

samples/subsys/usb/audio/headset/sample.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,11 @@ tests:
55
depends_on: usb_device
66
tags: usb
77
platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp
8+
harness: console
9+
harness_config:
10+
type: multi_line
11+
ordered: true
12+
regex:
13+
- "Entered main"
14+
- "Found USB Headset Device"
15+
- "USB enabled"

samples/subsys/usb/audio/headset/src/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,15 @@ void main(void)
7070
return;
7171
}
7272

73+
LOG_INF("Found USB Headset Device");
74+
7375
usb_audio_register(hs_dev, &ops);
7476

7577
ret = usb_enable(NULL);
7678
if (ret != 0) {
7779
LOG_ERR("Failed to enable USB");
7880
return;
7981
}
82+
83+
LOG_INF("USB enabled");
8084
}

0 commit comments

Comments
 (0)