winit
winit copied to clipboard
Add integration testing
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.
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
?
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.