4 个版本
0.2.0 | 2023 年 11 月 11 日 |
---|---|
0.1.2 | 2023 年 6 月 22 日 |
0.1.1 | 2023 年 5 月 19 日 |
0.1.0 | 2023 年 5 月 19 日 |
#508 在 Unix API
98 每月下载量
20KB
163 代码行
winit-test
winit-test
为测试 winit
应用程序提供了一个简单的测试平台。
使用方法
将您的测试添加到 Cargo.toml
中,并使用 harness = false
选项。这将防止 Rust 的默认测试平台运行您的测试。
[[test]]
name = "my_test"
path = "tests/my_test.rs"
harness = false
然后,在您的测试中,使用 winit_test::main!
宏来运行您的测试。测试必须是接受 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);
许可证
根据以下任一许可证授权
- Apache License, Version 2.0 (LICENSE-APACHE 或 https://apache.ac.cn/licenses/LICENSE-2.0)
- MIT 许可证 (LICENSE-MIT 或 https://opensource.org/licenses/MIT)
- Zlib 许可证 (LICENSE-ZLIB 或 https://opensource.org/licenses/Zlib)
任选其一。
贡献
除非您明确声明,否则根据 Apache-2.0 许可证定义的,您有意提交以包含在作品中的任何贡献,都将根据上述条款双许可,不附加任何额外条款或条件。
依赖项
~2–17MB
~250K SLoC