testx-rs: An extended Rust testcase
The testx crate provides the testx macro, which is an extended version
of the Rust test macro. The key features are:
- The
testxmacro is fully compatible for the Rusttestmacro, all tests maked with#[testx](instead of#[test]) are executed withcargo-test. - Support for a test preparation function.
Getting started
Create a testx testcase
Mark the testcase with #[testx]. Calling cargo test will execute the
testcase.
use testx;
// output:
// running 1 test
// test sample ... ok
Prepare data for a testcase with a setup function
Provide a function setup which prepares and returns some data for your
testcase. Next, your testcase needs one argument, which must match the
return value of the setup function.
A testcase marked with #[testx] will first execute the setup function
and will pass its return value to your testcase.
use testx;
Installation
Put the following line into the [dev-dependencies] section of your Cargo.toml:
[]
= "0.1.2"