New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add wlcs tests #22
Add wlcs tests #22
Conversation
This embeds libwlcs as a git submodule and adds the ability to get a Wayland client socket fd from mir::Server so that the wlcs tests can run against Mir. The wlcs tests currently fail against Mir. Yay for tests!
…xtures. The Wayland frame events are driven by the surface's buffer being bound, *not* by the buffer being requested by the compositor. The wlcs tests now don't hang, and instead fail because Mir isn't protocol-compliant. Yay!
We need to do this eagerly because wl_shm_buffer_end_access(buffer) can attempt to send a protocol error on buffer when SIGBUS is raised. This has to be done on the Wayland thread. Furthermore, wl_shm_buffer_begin_access()/wl_shm_buffer_end_access() need to be called on the same thread, so we can't just punt wl_shm_buffer_end_access() to the eventloop. Since we don't want the renderer thread to block waiting on the Wayland eventloop to process the buffer we eagerly copy and then just upload the previously-copied data on bind(). As an optimisation this should be changed so that the glTexImage2D call is made on construction, taking the (slow) texture upload off the renderer hotpath.
… configure message. The bad buffer test causes a protocol error to be raised; this results in the client being disconnected and all its resources being destroyed. Since we punt the initial wl_shell_surface_send_configure request out to the eventloop it might get run after the protocol error causes everything to be torn down, resulting in a crash. We probably need to factor this out into a generic event-sender, but for now this lets us pass the wlcs tests.
It will manage its own licencing, thank you.
When I build and run locally I see (once I persuaded make to even run the wlcs test): The following tests FAILED: Both tests segfault! Not sure what happens in CI - there's no output from the test run. |
It is always wrong when "(this=0x0" (gdb) bt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// It's safe to free the buffer after the release event has been received.
buffer->add_release_listener([buffer = std::move(buffer)]() { return false; });
But it is not safe to use buffer->add_release_listener when it isn't sequence-before the std::move()
OK, I've proposed a fix against wlcs. But that doesn't get everything working.
$ ctest -V -R .wlcs. 50% tests passed, 1 tests failed out of 2 Total Test time (real) = 15.64 sec The following tests FAILED: |
I've pushed the fix for mir_wlcs_tests to wlcs - was just bad setup in mir_integration.cpp Still need to work out what's happening with getting the tests to actually run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In any case, these tests are leaking FDs and fail with ENABLE_MEMCHECK_OPTION=on
This is what doesn't work for me:
However:
|
anyway, I think we can leave that as an exercise for later. bors r+ |
Build succeeded |
This integrates
wlcs
with the Mir test-suite, gated on MIR_RUN_ACCEPTANCE_TESTS.It then fixes the bugs exposed!