3 releases

Uses old Rust 2015

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

#636 in Testing

Download history 39/week @ 2023-12-06 74/week @ 2023-12-13 57/week @ 2023-12-20 47/week @ 2023-12-27 75/week @ 2024-01-03 81/week @ 2024-01-10 73/week @ 2024-01-17 37/week @ 2024-01-24 31/week @ 2024-01-31 44/week @ 2024-02-07 100/week @ 2024-02-14 98/week @ 2024-02-21 112/week @ 2024-02-28 86/week @ 2024-03-06 69/week @ 2024-03-13 102/week @ 2024-03-20

388 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.9–1.3MB
~17K SLoC