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

#3 in #run-testing

Download history 156/week @ 2025-04-22 198/week @ 2025-04-29 275/week @ 2025-05-06 240/week @ 2025-05-13 456/week @ 2025-05-20 324/week @ 2025-05-27 291/week @ 2025-06-03 241/week @ 2025-06-10 267/week @ 2025-06-17 338/week @ 2025-06-24 221/week @ 2025-07-01 117/week @ 2025-07-08 127/week @ 2025-07-15 171/week @ 2025-07-22 293/week @ 2025-07-29 124/week @ 2025-08-05

733 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–18MB
~261K SLoC