loomy

Crates.ioloomy
lib.rsloomy
version0.1.1
sourcesrc
created_at2022-02-10 00:15:35.558633
updated_at2022-02-10 00:25:26.392237
descriptionA shim to easily run loom tests
homepage
repositoryhttps://github.com/overdrivenpotato/loomy
max_upload_size
id529966
size6,581
Marko Mijalkovic (overdrivenpotato)

documentation

README

loomy

Crates.io [Documentation][docs]

A shim crate to easily test code with loom.

// std or loom, chosen at compile time by crate feature.
use loomy::{thread, cell::UnsafeCell};

struct Foo {
    cell: UnsafeCell<...>,
}

#[test]
fn test_example() {
    // When using `std`, `loomy::model` only invokes the closure and nothing
    // more.
    loomy::model(|| {
        // ...
        thread::spawn(|| {
            // ...
        });
        // ...
    });
}

Run tests with std:

$ cargo test

Run tests with loom:

$ cargo test --features loomy/enable
Commit count: 2

cargo fmt