Skip to content
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 proper testing #5

Closed
serenity4 opened this issue Oct 28, 2020 · 3 comments
Closed

Add proper testing #5

serenity4 opened this issue Oct 28, 2020 · 3 comments

Comments

@serenity4
Copy link
Collaborator

The package currently fails for CI testing, because the tests are made to be interactively run: opening a window, pressing some keys, moving the mouse around, closing the window.

Testing can be done with a virtual framebuffer through xvfb. However, we need to manually send events to the X server, since no input device can be used. A solution consists in sending events to the X server with xcb_send_event, thus faking inputs. To do that, we need a way to translate some keystroke (let's say, I want to press 'a') to a keycode, that is used as event data.

@serenity4
Copy link
Collaborator Author

serenity4 commented Oct 28, 2020

This is a good opportunity to actually work on properly handling inputs. For now, there is no keymap registration, and keyboard state is not considered for converting keycodes to characters. xkbcommon and xcb-xkb handle this kind of stuff, including weird keyboard layouts.

@serenity4
Copy link
Collaborator Author

Related PR: #6

@serenity4
Copy link
Collaborator Author

Tests now ensure that windows can be created, receive events, and close upon an emulated keystroke. The issue is therefore resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant