4 releases

0.2.0 Nov 11, 2023
0.1.2 Jun 22, 2023
0.1.1 May 19, 2023
0.1.0 May 19, 2023

#295 in Unix APIs

Download history 74/week @ 2023-12-15 39/week @ 2023-12-22 2/week @ 2023-12-29 218/week @ 2024-01-05 28/week @ 2024-01-12 6/week @ 2024-01-19 204/week @ 2024-01-26 27/week @ 2024-02-02 199/week @ 2024-02-09 11/week @ 2024-02-16 21/week @ 2024-02-23 166/week @ 2024-03-01 169/week @ 2024-03-08 74/week @ 2024-03-15 12/week @ 2024-03-22 69/week @ 2024-03-29

329 downloads per month
Used in softbuffer

MIT OR Apache-2.0 OR Zlib

20KB
163 lines

winit-test

winit-test provides a simple test harness for testing winit applications.

How to Use

Add your test to Cargo.toml with the harness = false option. This will prevent Rust's default test harness from running your test.

[[test]]
name = "my_test"
path = "tests/my_test.rs"
harness = false

Then, in your test, use the winit_test::main! macro to run your tests. The tests must be functions that take an EventLoopWindowTarget.

use winit_test::winit::event_loop::EventLoopWindowTarget;

fn my_test(elwt: &EventLoopWindowTarget<()>) {
    // ...
}

fn other_test(elwt: &EventLoopWindowTarget<()>) {
    // ...
}

winit_test::main!(my_test, other_test);

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~2–19MB
~256K SLoC