Skip to content

Commit 5f1c37f

Browse files
committed
apause.exp: catch and print error messages and exit immediately
Fail fast and avoid timeouts. This is especially important considering pause will soon be disabled by default: - thesofproject/linux#5041 Signed-off-by: Marc Herbert <marc.herbert@intel.com>
1 parent dcf08b0 commit 5f1c37f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

case-lib/apause.exp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,20 @@ set volume_always_zero true
137137

138138
expect {
139139

140+
# `man re_syntax` claims that Tcl regular expressions are compliant
141+
# with the basic and extended POSIX ones while adding a 3rd,
142+
# extended flavor. It's not clear which flavor `expect -re` uses
143+
# but it's not the basic one.
144+
# Use {} not "" to avoid quoting issues and backslash proliferation.
145+
140146
# When multiple patterns match, first pattern wins.
141147

148+
-nocase -re {error.*\r|PAUSE.*no[[:blank:]]*hw[[:blank:]]*support.*\r} {
149+
set buffer_with_lf "[cr_to_lf $expect_out(buffer)]"
150+
log 0 "ERROR: $buffer_with_lf"
151+
exit 1
152+
}
153+
142154
# Volume xx% or MAX line
143155
#
144156
# When not backpressured by a sleeping (=bad!) Expect process,

0 commit comments

Comments
 (0)