Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
oops.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
My box here takes just under 1200 ms to terminate a full server, which is
just over the current default timeout of 1000, causing the examples to fail.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Prevent callers from getting odd errors if they notice the wait fails
because the child is still running and errno is still on whatever it was
before.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
SCOPED_TRACE will only print if the current scope fails and this can never
happen here. Change one message to standard printf, drop the others.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Every so-often, the server doesn't terminate fast enough and we fail the
test. Put a wait loop in.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
No need to specify those when waiting for core or extension events that are
not GenericEvents.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
export XORG_GTEST_USE_VALGRIND="valgrind --leak-check=full"
./run-some-test
But really, can be used with any wrapper binary. Given that valgrind is the
main use-case here, keep the USE_VALGRIND naming instead of something more
generic like USE_PROCESS_WRAPPER or so.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Need to actually use X11_CFLAGS and EVEMU_CFLAGS in CPPFLAGS, CXXFLAGS
(and presumably CFLAGS if that were relevant).
Also must search local directories before system directories for our
header files, otherwise installed versions will override local
versions which would be bad.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Xlib's default error handler prints the error and calls exit(1). Tests that
accidentally trigger an error thus quit without cleaning up properly.
Install a default error handler that prints the basic info and continue with
the test. Clients that expect to trigger errors should set a custom error
handler.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
|
|
This header is for self-testing, specifically EXPECT_FATAL_FAILURE
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
|
|
make distcheck fails since the tests are not run from the test/ directory
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Fixes distcheck
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
This example relies on the Environment class, make that more obvious. And
add more comments and test cases to show the usage.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
SIGUSR1 is triggered on server regeneration too, not just on startup. And
any test that wants to handle SIGUSR1 for other stuff needs to set a signal
handler anyway.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
/tmp is fine in most cases, but make it configurable through a configure
option
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
This was moved out of the Environment when the XServer class was added, but
it really doesn't belong there. Users of XServer should set custom config
and log file paths (if any) directly instead of having to undo the
libraries' defaults.
Move it back into the environment to avoid breaking users of that, but
really, this shouldn't even be in the environment either but rather in the caller
that needs those defaults.
Also move default path and display settings. Note that these are the same
defaults in the environment and in the server.
Since we can't rely on -displayfd yet, I'll leave the default display in
XServer to ensure the server always starts up (:133 is not likely to be in
use) and to auto-compose the display string for XOpenDisplay().
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Allow removing an option from the command list too.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Allows calls like server.SetOption("-noreset");
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Subclassed servers may need to override this behaviour
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Otherwise the child will continue to run tests in parallel with the parent,
causing conflicts.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Virtually everyone trying the tests the first time will run into this issue
since we cannot check if the ABI for dummy and whatever else is needed
actually matches the server (well, we have a test for that, but unless you
run that one first...)
So be at least more verbose about the potential reasons and provide some
basic debugging help.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
_x_io_error_handler is a noreturn function.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
If set, XServer will ignore Terminate() and Kill() requests, and will not
die if the parent process dies. This enables a user to hook up gdb to a
server, wait for the test case to trigger some code in the server and
continue debugging from there, without the test case terminating the server.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
|
|
The child must have SIGUSR1 set to SIG_IGN so the XServer will notify us
when it is ready to accept connection.
The parent must block SIGUSR1 until ready to receive them, but the server
must _not_ have that mask blocked. Otherwise, it won't react to VT switches.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
|
|
Process::Start() will fork() and execvp() the child process. For use-cases
where the child process must have specific signal masks or other properties
before the execvp() call this is unfeasable, the caller cannot control the
properties of the child between forking and execvp.
Split the fork() call out into Process::Fork(), making it optional. Start()
will fork on demand if it hasn't been called before. Behaviour stays the
same for callers of Start(), only those that call Fork() first need to pay
attention to details.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
|
|
A server without a config file that inits all input devices takes just over
a second on my machine. Up this timeout so we don't get spurious signals
later.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Conflicts:
test/xserver-test.cpp
|
|
|
|
Once a server is started, set the X IO error handler to throw an exception.
This way our test cases will survive a server crash and googletest will just
continue with the next test case instead of exiting the process completely.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
../gtest/include/gtest/gtest.h:18470:136: warning: comparison between signed
and unsigned integer expressions [-Wsign-compare]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit ef25a6b6f3f387a119ab9261f37479fe415702d4)
|
|
../gtest/include/gtest/gtest.h:18470:136: warning: comparison between signed
and unsigned integer expressions [-Wsign-compare]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
If the device has initialised before we call WaitForDevice(), we still need
to return true.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Don't rely on the caller to set up the mask correctly, modify its current
mask to include the hierarchy mask and then un-do that modification (if
needed)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Terminate/Kill will only wait for the server to exit for a nonzero timeout,
requiring callers to always specify a timeout for it to be useful.
The use-case of sending a SIGTERM to the server but not waiting for
it to shut down is narrow, so require those to actually specify a zero
timeout instead of everyone else.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
|