littletest

Crates.iolittletest
lib.rslittletest
version0.2.2
sourcesrc
created_at2015-04-30 01:07:58.104408
updated_at2016-11-24 21:48:15.802352
descriptionA little testing library.
homepagehttps://github.com/justinlatimer/littletest
repositoryhttps://github.com/justinlatimer/littletest
max_upload_size
id1990
size9,433
Justin Latimer (justinlatimer)

documentation

https://github.com/justinlatimer/littletest

README

littletest

Build Status

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

Commit count: 31

cargo fmt