Skip to content

Commit

Permalink
Report failures properly
Browse files Browse the repository at this point in the history
  • Loading branch information
hegza committed Jul 30, 2024
1 parent 9d97099 commit 6bbd4bc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/hpc/test-memory-maps/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,24 @@ fn main() -> ! {
let cases = &tests::TEST_CASES;
let longest_uid = cases.iter().map(|t| t.uid.chars().count()).max().unwrap();
let count = cases.len();
let mut failures = 0;
for (idx, t) in cases.iter().enumerate() {
print_test_case_info(idx, count, longest_uid, t.uid, t.addr);
if let Err(e) = (t.function)() {
sprintln!(" {:?}", Error(e));
// Report failure but run to completion
report_fail();
failures += 1;
} else {
sprintln!(" reset value ok")
}
}

report_pass();
if failures == 0 {
report_pass();
} else {
report_fail();
}

loop {
wfi();
Expand Down

0 comments on commit 6bbd4bc

Please sign in to comment.