6 releases

0.2.4 Sep 11, 2022
0.1.4 Sep 3, 2022
0.1.3 Jun 15, 2022

#455 in Testing

Download history 1891/week @ 2024-09-05 2685/week @ 2024-09-12 1632/week @ 2024-09-19 1595/week @ 2024-09-26 2017/week @ 2024-10-03 1879/week @ 2024-10-10 1667/week @ 2024-10-17 2024/week @ 2024-10-24 1105/week @ 2024-10-31 1177/week @ 2024-11-07 1735/week @ 2024-11-14 1498/week @ 2024-11-21 677/week @ 2024-11-28 1033/week @ 2024-12-05 764/week @ 2024-12-12 427/week @ 2024-12-19

3,257 downloads per month
Used in 3 crates

Apache-2.0

7KB
57 lines

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 faster[^speed] and smaller than serial_test however offers less functionality.

[^speed]: 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.

Dependencies