-
Notifications
You must be signed in to change notification settings - Fork 125
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
Test: Use a xvfb wrapper for x11 test #348
Test: Use a xvfb wrapper for x11 test #348
Conversation
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.
Personally, the only thing that needs to be fixed is the typo, the rest is good enough for a test case. Some suggestions on improvements but at some point there's a valid effort vs gain argument...
5cc9f26
to
ff2b1dc
Compare
I closed #339 in favour of this PR. |
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.
LGTM! It'd be nice to have the x11 not rely on a running x server.
I think it's not necessary. |
9ea7271
to
975c05b
Compare
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.
my only "concern" right now is the different coding style in the wrapper function compared to the rest of xkbcommon (which also introduces a potential uninitialized variable bug). Other than that, the usual nitpicks but this LGTM, thanks.
kill(xvfb_pid, SIGTERM); | ||
fclose(display_fd); | ||
err_display_fd: | ||
return ret; |
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.
minor nitpick: if you declare and init the pid
and fd
variables to 0/-1 at the top of the functions, you can have a single error:
label that kills and closes since they're at default values. slight simplification
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.
Not sure of this: I get a warning if I set display_fd
to -1
. We surely do not want to depend on undefined behaviour.
The x11 test is currently silently skipped in CI, because it requires a running X server. Create a xvfb wrapper to run the test. We do not use `xvfb-run`, because it is a shell script and it causes valgrind to detect unrelated memory issues in the shell (dash, bash). Improve wrapper using a special ELF section TODO: The wrapper is intended to be used with the x11comp test as well.
Based on the work done by Peter Hutterer. Original commit message: If SIGUSR1 is set to SIG_IGN, X servers (all of them, including Xvfb) will send that signal to the parent process when they're ready to accept connections. We can use that instead of a hardcoded sleep which brings the wait down to ~37ms on my box.
This test was previously disabled in 914e84e. Note that it requires a recent version of xkeyboard-config to succeed.
xkeyboard-config and xkbcommon projects are quite intertwined so we want things to blow up early. It also solves an issue with the x11comp test.
1733d90
to
76b3799
Compare
Rebased & improved commits. Review done and tests passed. Let’s merge! |
The X11 test is currently silently skipped in CI. Use a
xvfb
wrapper to ensure to run it. See #339 for the rationale.The code is adapted from #339
and it is intended to be rebased on it, then refactor the x11comp test as well with the wrapper, which is closed in favour of this new PR.Question: should we use an option to disable the wrapper, in order to test with a local X11 server as previously?