6 releases

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

#283 in Testing

Download history 706/week @ 2024-01-03 884/week @ 2024-01-10 1094/week @ 2024-01-17 894/week @ 2024-01-24 1046/week @ 2024-01-31 761/week @ 2024-02-07 876/week @ 2024-02-14 1035/week @ 2024-02-21 1627/week @ 2024-02-28 2324/week @ 2024-03-06 1486/week @ 2024-03-13 820/week @ 2024-03-20 1007/week @ 2024-03-27 932/week @ 2024-04-03 1797/week @ 2024-04-10 1092/week @ 2024-04-17

5,038 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