Attribute Macro serial_test::parallel

source · []
#[parallel]
Expand description

Allows for the creation of parallel Rust tests that won’t clash with serial tests

#[test]
#[serial]
fn test_serial_one() {
  // Do things
}

#[test]
#[parallel]
fn test_parallel_one() {
  // Do things
}

#[test]
#[parallel]
fn test_parallel_two() {
  // Do things
}

Multiple tests with the parallel attribute may run in parallel, but not at the same time as serial tests. e.g. in the example code above, test_parallel_one and test_parallel_two may run at the same time, but test_serial_one is guaranteed not to run at the same time as either of them. parallel also takes key arguments for groups of tests as per serial.

Note that this has zero effect on file_serial tests, as that uses a different serialisation mechanism.