3 releases

Uses old Rust 2015

0.1.2 Apr 30, 2015
0.1.1 Apr 26, 2015
0.1.0 Apr 26, 2015

#769 in Testing

Download history 69/week @ 2024-07-21 83/week @ 2024-07-28 62/week @ 2024-08-04 75/week @ 2024-08-11 80/week @ 2024-08-18 101/week @ 2024-08-25 103/week @ 2024-09-01 78/week @ 2024-09-08 68/week @ 2024-09-15 300/week @ 2024-09-22 184/week @ 2024-09-29 211/week @ 2024-10-06 71/week @ 2024-10-13 51/week @ 2024-10-20 96/week @ 2024-10-27 152/week @ 2024-11-03

376 downloads per month
Used in fewer than 9 crates

Apache-2.0

5KB

Timebomb

Build Status

This is a simple timeout mechanism for Rust that is intended for use with unit tests.

extern crate timebomb;
use timebomb::timeout_ms;

#[test]
fn something_bad() {
	// This will timeout in 1 second if the test did not pass
	timeout_ms(|| {
		// oops infinite loop
		loop {}
	}, 1000);
}

Dependencies

~0.8–1.3MB
~18K SLoC