summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-12-20xorg-gtest 0.7.0HEADmasterPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-20xserver: usecs are usecs, not millisPeter Hutterer1-1/+1
oops. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-14xserver: increase default Terminate/Kill timeout to 2 secondsPeter Hutterer1-2/+2
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>
2012-12-14process: if the wait fails because the child is still running, reset errnoPeter Hutterer1-1/+5
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>
2012-12-14process: drop a few SCOPED_TRACEPeter Hutterer1-6/+3
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>
2012-12-14examples: Document two variables to silence doxygenPeter Hutterer2-0/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-14test: restore error handler after testPeter Hutterer1-1/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-14test: wait a bit for the server to finishPeter Hutterer1-0/+5
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>
2012-12-14test: unset environment variable after usePeter Hutterer1-0/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-14xserver: default to -1/-1 for extension/opcodePeter Hutterer1-1/+1
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>
2012-12-14Add support for starting a process through valgrindPeter Hutterer3-1/+123
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>
2012-12-05Fix CFLAGS to find correct header filesKeith Packard3-9/+11
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>
2012-11-09xserver: install default X error handlerPeter Hutterer3-0/+130
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>
2012-11-07gtest: add gtest-spi.h headerPeter Hutterer2-1/+233
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>
2012-11-07test: conf paths must be absolutePeter Hutterer1-2/+2
make distcheck fails since the tests are not run from the test/ directory Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-07test: change USB mouse recordings file to dist_noinst_DATAPeter Hutterer1-1/+1
Fixes distcheck Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-07examples: add test examples for manual XServer controlPeter Hutterer2-1/+111
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-07examples: rename xorg-gtest-example to indicate it's an Environment examplePeter Hutterer3-11/+93
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>
2012-11-07xserver: ignore SIGUSR1 in the parent after server startupPeter Hutterer1-0/+4
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>
2012-11-07Make default log path configurablePeter Hutterer5-10/+65
/tmp is fine in most cases, but make it configurable through a configure option Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-07Move default log/config setting back to environmentPeter Hutterer4-11/+20
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>
2012-11-07xserver: add RemoveOptionPeter Hutterer6-1/+51
Allow removing an option from the command list too. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-07xserver: make second arg to SetOption() default to ""Peter Hutterer2-1/+1
Allows calls like server.SetOption("-noreset"); Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-07xserver: change Start() to be virtualPeter Hutterer1-1/+1
Subclassed servers may need to override this behaviour Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-07test: exit(0) the xserver test after forkingPeter Hutterer1-1/+1
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>
2012-11-07examples: use abs_top_srcdir to link to the config filePeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-07Drop .gz tarballs, bz2 is enoughPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-06Expand on the default 'failed to open connection to display' errorPeter Hutterer1-2/+9
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>
2012-10-29xorg-gtest-main: fix trailing whitespacePeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-29test: add process-test-helper to gitignorePeter Hutterer1-0/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-29xserver: shut up compiler warningPeter Hutterer1-0/+1
_x_io_error_handler is a noreturn function. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-29xserver: add XORG_GTEST_XSERVER_KEEPALIVE environment variablePeter Hutterer3-0/+82
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>
2012-10-29xserver: use new fork handling for signal masksPeter Hutterer1-28/+46
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>
2012-10-29process: split Fork() and Start() into (optionally) two callsPeter Hutterer3-3/+76
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>
2012-10-29xserver: increase timout to 3 secondsPeter Hutterer1-1/+1
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>
2012-10-25xorg-gtest 0.6.0Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-23Merge branch 'xlib-io-error-handler2'Peter Hutterer3-0/+67
Conflicts: test/xserver-test.cpp
2012-10-23Merge branch 'wait-for-device-fix'Peter Hutterer2-4/+225
2012-10-17xserver: add default X IO error handlerPeter Hutterer3-0/+68
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>
2012-10-17include: add inclusion guards to xorg-gtest.hPeter Hutterer1-0/+5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-17include: add XORG_TESTCASE() macro for standardised printing of descriptionsPeter Hutterer4-17/+23
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-17tests: drop gtest.h include, xorg-gtest.h pulls it in anywayPeter Hutterer1-1/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-17examples: fix compiler warningPeter Hutterer1-1/+1
../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)
2012-10-16examples: fix compiler warningPeter Hutterer1-1/+1
../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>
2012-10-16xserver: query device list before waitingPeter Hutterer1-0/+9
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>
2012-10-16xserver: set the hierarchy mask before WaitForDevicePeter Hutterer2-4/+216
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>
2012-10-16include: add inclusion guards to xorg-gtest.hPeter Hutterer1-0/+5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-16include: add XORG_TESTCASE() macro for standardised printing of descriptionsPeter Hutterer4-17/+23
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-11tests: drop gtest.h include, xorg-gtest.h pulls it in anywayPeter Hutterer1-1/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-10xserver: use a default timout for 1s for Terminate() and Kill()Peter Hutterer1-2/+2
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>