Skip to content

Commit

Permalink
samples: philosophers: Fix output to allow Renode to pass
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
d3zd3z committed Oct 28, 2024
1 parent 72101b1 commit e0f2dda
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion samples/philosophers/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ common:
regex:
# Match the statistics, and make sure that each philosopher has at least 10 (two digits)
# meals.
- "^\\[\\d{2,}, \\d{2,}, \\d{2,}, \\d{2,}, \\d{2,}, \\d{2,}\\]"
- "c:\\[\\d{2,}, \\d{2,}, \\d{2,}, \\d{2,}, \\d{2,}, \\d{2,}\\]"
tags: rust
filter: CONFIG_RUST_SUPPORTED
tests:
Expand Down
2 changes: 1 addition & 1 deletion samples/philosophers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ impl Stats {
}

fn show(&self) {
printkln!("{:?}, e:{:?}, t:{:?}", self.count, self.eating, self.thinking);
printkln!("c:{:?}, e:{:?}, t:{:?}", self.count, self.eating, self.thinking);
}
}

Expand Down

0 comments on commit e0f2dda

Please sign in to comment.