Add NewEvents(Init) callback to x11#1031
Conversation
|
Thx for this. You can try to work from the failing Travis builds to see if you can fix them, if they look straightforward to you. |
|
Based on this output it looks like tests are not run on the main thread. I don't know for sure, but perhaps Rust tests are run in multiple threads for speed ups. Maybe there is an option to get them to run on a single (main) thread instead? @rikusalminen Can you insert an assertion into the tests you added to make sure they are run from the main thread? I suspect that change would cause them to fail on your system too until you figure out how to run tests single-threaded. Curious to hear back from you how this all turns out! |
|
Unfortunately it does not seem like there's a way to make @felixrabe please advice what to try next? Make the test(s) skip on macos? In any case, the actual fix patch can be merged (or cherry-picked) while thinking about a solution for running tests on macos. Are there plans for creating tests that actually use the windowing API? |
|
I also noticed that Linux travis tests will fail because no backends can be initialized. |
|
I suggest you revert the tests (or force-push on a branch that does not have tests ; also update the title of this PR), and open a separate PR for just the tests. Then we can merge this change (if the project owners think it is good), and discuss how to approach testing in the new PR. |
bb86867 to
1ea29b4
Compare
Before starting the event loop, invoke callback with NewEvents(StartCause::Init).
|
I have removed the test case from this pull request. I'll consider what to do with it, maybe it could be put on the examples folder instead of automatic testing. This PR is ready for being merged. |
|
@rikusalminen There's been talk at various points of creating an interactive test suite since a large portion of Winit is hard to automatically test, so it may make sense to put this test in there if somebody starts work to create it. |
commit 1ea29b4 Author: Riku Salminen <[email protected]> Date: Tue Jul 9 13:02:02 2019 +0300 x11: NewEvents(StartCause::Init) callback at start Before starting the event loop, invoke callback with NewEvents(StartCause::Init).
On X11,
Event::NewEvents(StartCause::Init)was not delivered as first event.̃
I added a test case to run on an event loop without any windows attached and check that first event isNewEvents(Init), thenControlFlow::Exitand check that last event isLoopDestroyed.I have ran this test on Linux/x11 platform only.
Help wanted: please run the new test on macos and windows.
cargo fmthas been run on this branch