6 releases

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

#302 in Testing

Download history 1362/week @ 2024-03-14 813/week @ 2024-03-21 1071/week @ 2024-03-28 970/week @ 2024-04-04 1759/week @ 2024-04-11 1565/week @ 2024-04-18 2098/week @ 2024-04-25 1556/week @ 2024-05-02 2228/week @ 2024-05-09 2082/week @ 2024-05-16 1712/week @ 2024-05-23 2256/week @ 2024-05-30 2309/week @ 2024-06-06 1990/week @ 2024-06-13 1756/week @ 2024-06-20 961/week @ 2024-06-27

7,574 downloads per month
Used in 2 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