Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtechkral committed Feb 5, 2024
1 parent bc78c72 commit 6a44c8f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@

`cargo fixture` is a cargo extension that let's you surround `cargo test` with arbitrary Rust setup and teardown code.

In pseudo-code:

```rust
cargo fixture [args...] {
fixture.rs {
// your setup code
let result = cargo test [args...]
// your cleanup code
}
}
```

It can be used to run network servers that tests connect to, spin up docker containers, prepare test data, check for presence of programs,... or really anything that can be done from Rust code. Any provided resources can be released after `cargo test` finishes, whether manually, using RAII guards or closures.

Data can be passed from fixture to tests using environment variables, in-memory K-V storage, or files. Additionally, the option to define serial tests is provided.
Expand Down

0 comments on commit 6a44c8f

Please sign in to comment.