ntest_timeout 0.6.0

Timeout attribute for the ntest framework.
Documentation

NTest Timeout

Part of the NTest library. Add the timeout attribute to the rust test framework using procedural macros.

Examples

This example will not panic:

#[test]
#[timeout(100)]
fn no_timeout() {
    let fifty_millis = time::Duration::from_millis(50);
    thread::sleep(fifty_millis);
}

This example will panic. The function panics after 10 milliseconds:

#[test]
#[timeout(10)]
#[should_panic]
fn timeout() {    
	let fifty_millis = time::Duration::from_millis(50);    		
	thread::sleep(fifty_millis);}rust
}

For more examples and information read the documentation.