Attribute Macro serial_test::file_parallel
source · #[file_parallel]
Available on crate feature
file_locks
only.Expand description
Allows for the creation of file-serialised parallel Rust tests that won’t clash with file-serialised serial tests
#[test]
#[file_serial]
fn test_serial_one() {
// Do things
}
#[test]
#[file_parallel]
fn test_parallel_one() {
// Do things
}
#[test]
#[file_parallel]
fn test_parallel_two() {
// Do things
}
Effectively, this should behave like parallel but for file_serial. Note that as per file_serial this doesn’t do anything for serial/parallel tests.
It also supports an optional path
arg as well as key(s) as per serial.
#[test]
#[file_parallel(key, path => "/tmp/foo")]
fn test_parallel_one() {
// Do things
}
#[test]
#[file_parallel(key, path => "/tmp/foo")]
fn test_parallel_another() {
// Do things
}
The path defaults to a reasonable temp directory for the OS if not specified. If the path
is specified, you can only use one key.