Raw-rs: run tests in parallel (#1968)

* Run raw-rs tests in parallel

* cargo fmt

* Fix clippy warnings

* Use Fast CompressionType to speed up the tests

* Fix benches

* Use cfg_attr instead of cfg.

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Elbert Ronnie
2024-09-20 16:39:58 +05:30
committed by GitHub
parent e352c7fa71
commit d68f91ccca
4 changed files with 67 additions and 38 deletions

View File

@@ -42,6 +42,8 @@ fn compile_to_proto(c: &mut Criterion) {
#[cfg_attr(all(feature = "iai", not(feature = "criterion")), library_benchmark)]
#[cfg_attr(all(feature = "iai", not(feature="criterion")), benches::with_setup(args = ["isometric-fountain", "painted-dreams", "procedural-string-lights", "red-dress", "valley-of-spires"], setup = load_from_name))]
// Note that this can not be disabled with a `#[cfg(...)]` because this causes a compile error.
// Therefore negated condition is used in `#[cfg_attr(...)]` with the attribute `cfg(any())` that is always false.
pub fn iai_compile_to_proto(_input: NodeNetwork) {
#[cfg(all(feature = "iai", not(feature = "criterion")))]
black_box(compile(_input));
@@ -57,5 +59,6 @@ library_benchmark_group!(name = compile_group; benchmarks = iai_compile_to_proto
#[cfg(all(not(feature = "criterion"), feature = "iai"))]
main!(library_benchmark_groups = compile_group);
// An empty main function so the crate compiles with no features enabled.
#[cfg(all(not(feature = "criterion"), not(feature = "iai")))]
fn main() {}