Skip to content

Commit 20d1660

Browse files
committed
samples: philosophers: Fix output to allow Renode to pass
The renode simulator prints some log message text in front of each debug message, which unfortunately causes the tests to fail. Fix this by adding a "c:" in front of the part we want to match, and removing the anchor from the regex. Signed-off-by: David Brown <[email protected]>
1 parent 59c0471 commit 20d1660

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

samples/philosophers/sample.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ common:
88
regex:
99
# Match the statistics, and make sure that each philosopher has at least 10 (two digits)
1010
# meals.
11-
- "^\\[\\d{2,}, \\d{2,}, \\d{2,}, \\d{2,}, \\d{2,}, \\d{2,}\\]"
11+
- "c:\\[\\d{2,}, \\d{2,}, \\d{2,}, \\d{2,}, \\d{2,}, \\d{2,}\\]"
1212
tags: rust
1313
filter: CONFIG_RUST_SUPPORTED
1414
tests:

samples/philosophers/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl Stats {
202202
}
203203

204204
fn show(&self) {
205-
printkln!("{:?}, e:{:?}, t:{:?}", self.count, self.eating, self.thinking);
205+
printkln!("c:{:?}, e:{:?}, t:{:?}", self.count, self.eating, self.thinking);
206206
}
207207
}
208208

0 commit comments

Comments
 (0)