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

#535 in Unix APIs

Download history 82/week @ 2024-10-16 36/week @ 2024-10-23 22/week @ 2024-10-30 24/week @ 2024-11-06 33/week @ 2024-11-13 29/week @ 2024-11-20 20/week @ 2024-11-27 22/week @ 2024-12-04 39/week @ 2024-12-11 45/week @ 2024-12-18 27/week @ 2024-12-25 8/week @ 2025-01-01 23/week @ 2025-01-08 22/week @ 2025-01-15 16/week @ 2025-01-22 18/week @ 2025-01-29

80 downloads per month

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–17MB
~258K SLoC