rust-windowing / winit

Window handling library in pure Rust
https://docs.rs/winit/
Apache License 2.0
4.56k stars 879 forks source link

Add integration testing #2866

Open notgull opened 1 year ago

notgull commented 1 year ago

winit is for all intents and purposes tested either by hand or in prod. We should have integration tests run in CI to make sure that there aren't any regressions in our code, as well as to reduce the burden on maintainers to test the code.

The X11 backend can be tested using xvfb, and Windows generally doesn't have an issue with running heedlessly. Android can be tested using the Android virtual device that comes with the Linux image and iOS can be tested via the iOS simulator on the macOS image. Web should also be pretty easy to test with a headless browser. I'm not so sure about the other platforms.

daxpedda commented 1 year ago

I'm not sure what exactly is possible to simulate on other backends in CI, but for Web you can use WebDriver to basically do everything. I've used fantoccini with great success in the past.

I think it would be nice to potentially integrate stuff like that into winit-test?

madsmtm commented 3 months ago

Linking https://github.com/rust-windowing/winit/pull/3593#discussion_r1543486525:

for the purpose of integration tests, we should probably have some sort of mechanism to [run a closure shortly inside of the event loop] more easily.