All Projects → palfrey → serial_test

palfrey / serial_test

Licence: MIT license
Allows for the creation of serialised Rust tests

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to serial test

daemonize-me
Rust library to ease the task of creating daemons
Stars: ✭ 34 (-67.62%)
Mutual labels:  rust-library
enumset
A library for compact bit sets containing enums.
Stars: ✭ 60 (-42.86%)
Mutual labels:  rust-library
harsh
Hashids implementation in Rust
Stars: ✭ 48 (-54.29%)
Mutual labels:  rust-library
healthchecks-rs
Simple Rust library to interact with healthchecks.io
Stars: ✭ 16 (-84.76%)
Mutual labels:  rust-library
font8x8-rs
8x8 monochrome bitmap fonts for rendering. Implemented in Rust.
Stars: ✭ 15 (-85.71%)
Mutual labels:  rust-library
Curio
A Blazing Fast HTTP Client
Stars: ✭ 35 (-66.67%)
Mutual labels:  rust-library
kul
A unique textual notation that can be used as both a data format and a markup language and that has powerful extensibility of both lexical syntax and semantics, and a Rust library for parsing it.
Stars: ✭ 12 (-88.57%)
Mutual labels:  rust-library
vpsearch
C library for finding nearest (most similar) element in a set
Stars: ✭ 27 (-74.29%)
Mutual labels:  rust-library
soap-rs
SOAP client for Rust programming language
Stars: ✭ 37 (-64.76%)
Mutual labels:  rust-library
blinkt
A Rust library for the Pimoroni Blinkt!, and any similar APA102 or SK9822 LED strips or boards, on a Raspberry Pi.
Stars: ✭ 18 (-82.86%)
Mutual labels:  rust-library
unicode-linebreak
󠁼💔 Implementation of the Unicode Line Breaking Algorithm in Rust
Stars: ✭ 14 (-86.67%)
Mutual labels:  rust-library
requests-rs
Rust HTTP client library styled after awesome Python requests
Stars: ✭ 37 (-64.76%)
Mutual labels:  rust-library
rust-pkcs11
Rust PKCS#11 Library
Stars: ✭ 70 (-33.33%)
Mutual labels:  rust-library
ArmorLib
Easily scan files for threats to security and privacy. A Rust library and command line tool. WIP.
Stars: ✭ 20 (-80.95%)
Mutual labels:  rust-library
rust-rgb
struct RGB for sharing pixels between crates
Stars: ✭ 70 (-33.33%)
Mutual labels:  rust-library
version-compare
↔️ Rust library to easily compare version strings. Mirror from https://gitlab.com/timvisee/version-compare
Stars: ✭ 32 (-69.52%)
Mutual labels:  rust-library
simple redis
Simple and resilient redis client for rust.
Stars: ✭ 21 (-80%)
Mutual labels:  rust-library
lonlat bng
A multithreaded Rust library with FFI for converting WGS84 longitude and latitude coordinates into BNG (OSGB36) Eastings and Northings and vice versa (using OSTN15)
Stars: ✭ 20 (-80.95%)
Mutual labels:  rust-library
rust-lp-modeler
Lp modeler written in Rust
Stars: ✭ 75 (-28.57%)
Mutual labels:  rust-library
telnet-rs
A simple implementation of Telnet in Rust.
Stars: ✭ 35 (-66.67%)
Mutual labels:  rust-library

serial_test

Version Downloads Docs MIT license Build Status MSRV: 1.51.0

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. Tests without the serial attribute may run at any time, including in parallel to tests marked as serial. Note that if you're using an async test reactor attribute (e.g. tokio::test or actix_rt::test) then they should be listed before serial, otherwise we don't get an async function and things break. There's now an error for this case to improve debugging.

For cases like doctests and integration tests where the tests are run as separate processes, we also support file_serial, with similar properties but based off file locking. Note that there are no guarantees about one test with serial and another with file_serial as they lock using different methods.

Usage

We require at least Rust 1.51. Upgrades to this will require at least a minor version bump (while in 0.x versions) and a major version bump post-1.0.

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].