Skip to content

Commit c8b1440

Browse files
committed
Provide more error context when a runtime benchmark group fails to compile
1 parent 1eb2656 commit c8b1440

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

collector/src/runtime/benchmark.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,16 @@ pub struct BenchmarkSuiteCompilation {
135135

136136
impl BenchmarkSuiteCompilation {
137137
pub fn extract_suite(self) -> BenchmarkSuite {
138-
assert!(self.failed_to_compile.is_empty());
138+
use std::fmt::Write;
139+
140+
if !self.failed_to_compile.is_empty() {
141+
let mut message =
142+
"Cannot extract runtime suite because of compilation errors:\n".to_string();
143+
for (group, error) in self.failed_to_compile {
144+
writeln!(message, "{group}\n{error}\n").unwrap();
145+
}
146+
panic!("{message}");
147+
}
139148
self.suite
140149
}
141150
}

0 commit comments

Comments
 (0)