6 releases

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

#292 in Testing

Download history 2091/week @ 2024-03-03 2015/week @ 2024-03-10 815/week @ 2024-03-17 954/week @ 2024-03-24 901/week @ 2024-03-31 1732/week @ 2024-04-07 1391/week @ 2024-04-14 2136/week @ 2024-04-21 1588/week @ 2024-04-28 2122/week @ 2024-05-05 1924/week @ 2024-05-12 2049/week @ 2024-05-19 1583/week @ 2024-05-26 2599/week @ 2024-06-02 1833/week @ 2024-06-09 2201/week @ 2024-06-16

8,342 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