#serial #testing #test #tests

dev serial_test

Allows for the creation of serialised Rust tests

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

#18 in Testing

Download history 4811/week @ 2020-08-13 4772/week @ 2020-08-20 5092/week @ 2020-08-27 5511/week @ 2020-09-03 6977/week @ 2020-09-10 5916/week @ 2020-09-17 6599/week @ 2020-09-24 6742/week @ 2020-10-01 6710/week @ 2020-10-08 6463/week @ 2020-10-15 8270/week @ 2020-10-22 8180/week @ 2020-10-29 7850/week @ 2020-11-05 10105/week @ 2020-11-12 9609/week @ 2020-11-19 7494/week @ 2020-11-26

31,039 downloads per month
Used in 66 crates (65 directly)

MIT license

7KB
72 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

~1–1.4MB
~32K SLoC