Skip to content

Commit 0811818

Browse files
insipxzjb0807
andauthored
add BenchmarkError::Weightless (#873)
* add BenchmarkError::Weightless * Update benchmarking/src/lib.rs Co-authored-by: zjb0807 <[email protected]> Co-authored-by: zjb0807 <[email protected]>
1 parent ddbb6be commit 0811818

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

benchmarking/src/lib.rs

+19
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,14 @@ macro_rules! impl_benchmark_test_suite {
11801180
$crate::str::from_utf8(benchmark_name)
11811181
.expect("benchmark name is always a valid string!"),
11821182
);
1183+
},
1184+
$crate::BenchmarkError::Weightless => {
1185+
// This is considered a success condition.
1186+
$crate::log::error!(
1187+
"WARNING: benchmark error weightless skipped - {}",
1188+
$crate::str::from_utf8(benchmark_name)
1189+
.expect("benchmark name is always a valid string!"),
1190+
);
11831191
}
11841192
}
11851193
},
@@ -1314,6 +1322,17 @@ macro_rules! add_benchmark {
13141322
.expect("benchmark name is always a valid string!")
13151323
);
13161324
None
1325+
},
1326+
Err($crate::BenchmarkError::Weightless) => {
1327+
$crate::log::error!(
1328+
"WARNING: benchmark weightless skipped - {}",
1329+
$crate::str::from_utf8(benchmark)
1330+
.expect("benchmark name is always a valid string!")
1331+
);
1332+
Some(vec![$crate::BenchmarkResult {
1333+
components: selected_components.clone(),
1334+
.. Default::default()
1335+
}])
13171336
}
13181337
};
13191338

0 commit comments

Comments
 (0)