5 releases
Uses old Rust 2015
0.2.2 | Nov 24, 2016 |
---|---|
0.2.1 | Nov 23, 2016 |
0.2.0 | May 9, 2015 |
0.1.1 | May 4, 2015 |
0.1.0 | Apr 30, 2015 |
#801 in Testing
8KB
215 lines
littletest
A Rust testing library inspired by Ruby's minitest. Useful for when you're porting something from Ruby or need tests generated at runtime.
Installation
Add this to your Cargo.toml
:
[dependencies]
littletest = "0.2"
and this to your crate root:
extern crate littletest;
Usage
Your tests needs to implement Runnable + Sync
- for example:
use littletest::{Runnable, TestResult}
struct TestCase {}
impl Runnable for TestCase {
fn run(&self) -> TestResult {
TestResult::Pass
}
}
Once you have a list of tests, use a test runner to run them.
use littletest::{Runnable, TestRunner, TestOptions}
fn run(tests: &Vec<Box<Runnable + Sync>>) {
let runner = TestRunner::new(true);
runner.run(tests);
}
License
MIT, See LICENSE
Dependencies
~1.5MB
~26K SLoC