Skip to content
Snippets Groups Projects
Commit 65df4a93 authored by thiolliere's avatar thiolliere Committed by GitHub
Browse files

Fix ignored error in benchmark tests (#8214)


* fix ignored error in benchmark tests

* use normal format for str

* explicit match

Co-authored-by: default avatarShawn Tabrizi <shawntabrizi@gmail.com>
parent 33b43589
No related merge requests found
......@@ -1169,9 +1169,16 @@ macro_rules! impl_benchmark_test_suite {
let mut anything_failed = false;
println!("failing benchmark tests:");
for benchmark_name in $bench_module::<$test>::benchmarks($extra) {
if let Err(err) = std::panic::catch_unwind(|| test_bench_by_name::<$test>(benchmark_name)) {
println!("{}: {:?}", String::from_utf8_lossy(benchmark_name), err);
anything_failed = true;
match std::panic::catch_unwind(|| test_bench_by_name::<$test>(benchmark_name)) {
Err(err) => {
println!("{}: {:?}", String::from_utf8_lossy(benchmark_name), err);
anything_failed = true;
},
Ok(Err(err)) => {
println!("{}: {}", String::from_utf8_lossy(benchmark_name), err);
anything_failed = true;
},
Ok(Ok(_)) => (),
}
}
assert!(!anything_failed);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment