sequential-test

Crates.iosequential-test
lib.rssequential-test
version0.2.4
sourcesrc
created_at2022-06-08 21:41:42.430355
updated_at2022-09-11 20:18:53.192707
descriptionAllows for the creation of sequential Rust tests.
homepage
repositoryhttps://github.com/JonathanWoollett-Light/sequential-test/
max_upload_size
id602268
size5,808
Jonathan Woollett-Light (JonathanWoollett-Light)

documentation

README

sequential-test

Version Downloads Docs APACHE 2.0 license

Allows for the creation of sequential tests.

#[cfg(test)]
mod tests {
    #[test]
    #[sequential]
    fn test1() {
        // ...
    }
    #[test]
    #[sequential]
    fn test2() {
        // ...
    }
    #[test]
    #[parallel]
    fn test3() {
        // ...
    }
}
  • Tests with the sequential attribute are guaranteed to be executed sequentially.
  • Tests with the parallel attribute may run in parallel of each other but will not run at the same time as tests with the sequential attribute.
  • Tests with neither attributes may run in parallel with any tests.

Defining sequential or parallel attributes on non-tests or within scopes is considered UB.

This library is both faster1 and smaller than serial_test however offers less functionality.

Footnotes

  1. The current benchmark illustrate sequential-test covers the test set in an average of ~350ms while serial_test covers the test set in an average of ~550ms.

Commit count: 16

cargo fmt