7 releases (4 breaking)

0.5.1 Nov 25, 2020
0.5.0 Aug 30, 2020
0.4.0 Feb 14, 2020
0.3.2 Dec 15, 2019
0.1.0 Dec 30, 2018

#225 in Testing

Download history 41071/week @ 2021-07-03 32836/week @ 2021-07-10 38399/week @ 2021-07-17 37796/week @ 2021-07-24 53909/week @ 2021-07-31 64872/week @ 2021-08-07 58515/week @ 2021-08-14 43246/week @ 2021-08-21 41649/week @ 2021-08-28 40011/week @ 2021-09-04 49040/week @ 2021-09-11 43490/week @ 2021-09-18 46808/week @ 2021-09-25 42807/week @ 2021-10-02 57951/week @ 2021-10-09 60648/week @ 2021-10-16

124,892 downloads per month
Used in 171 crates (13 directly)

MIT license

9KB
174 lines

serial_test

Version Downloads Docs MIT license Build Status MSRV: 1.39.0 dependency status

serial_test allows for the creation of serialised Rust tests using the serial attribute e.g.

#[test]
#[serial]
fn test_serial_one() {
  // Do things
}

#[test]
#[serial]
fn test_serial_another() {
  // Do things
}

#[tokio::test]
#[serial]
async fn test_serial_another() {
  // Do things asynchronously
}

Multiple tests with the serial attribute are guaranteed to be executed in serial. Ordering of the tests is not guaranteed however.

Usage

We require at least Rust 1.39 for async/await support

Add to your Cargo.toml

[dev-dependencies]
serial_test = "*"

plus use serial_test::serial; (for Rust 2018) or

#[macro_use]
extern crate serial_test;

for earlier versions.

You can then either add #[serial] or #[serial(some_text)] to tests as required.

Dependencies

~305–720KB
~18K SLoC