summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
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-14Add support for starting a process through valgrindPeter Hutterer1-0/+109
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 Packard1-4/+4
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 Hutterer1-0/+73
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-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-07Make default log path configurablePeter Hutterer1-8/+8
/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 Hutterer2-1/+10
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 Hutterer4-1/+37
Allow removing an option from the command list too. 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-10-29test: add process-test-helper to gitignorePeter Hutterer1-0/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-29xserver: add XORG_GTEST_XSERVER_KEEPALIVE environment variablePeter Hutterer1-0/+67
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-29process: split Fork() and Start() into (optionally) two callsPeter Hutterer1-0/+35
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-23Merge branch 'xlib-io-error-handler2'Peter Hutterer1-0/+16
Conflicts: test/xserver-test.cpp
2012-10-17xserver: add default X IO error handlerPeter Hutterer1-0/+17
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-16xserver: set the hierarchy mask before WaitForDevicePeter Hutterer1-0/+120
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 XORG_TESTCASE() macro for standardised printing of descriptionsPeter Hutterer3-17/+17
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-10test/process-test: prefix TESTCASE with newline in debugging outputPeter Hutterer1-8/+8
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
2012-10-10test/process-test: add test for starting the same process object multiple timesPeter Hutterer1-0/+86
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
2012-10-10test: add test for termination exit statusPeter Hutterer1-0/+10
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
2012-10-10test: add test-case for starting serversPeter Hutterer1-0/+16
With the SIGUSR1 patch, an XOpenDisplay() after XServer::Start() should always succeed. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
2012-10-10test: add helper program for process termination issuePeter Hutterer3-2/+44
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
2012-10-10test: rename two process testsPeter Hutterer1-2/+2
Termination can have different meaning for a process, rename the test cases to be more explicit Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
2012-10-10Fix up build system to use the googletest import buildPeter Hutterer1-3/+5
Drop the CHECK_GTEST macro, we can assume it's there now. We still build the gtest bits as convenience libraries, leave the various flags in there. Add $includedir/xorg to pgkconfig CPPFLAGS, as we install gtest.h in includedir/xorg/gtest/gtest.h to avoid overwriting or conflicts with a system-installed gtest.h Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
2012-08-29device: use inotify to wait for the device to appearPeter Hutterer4-2/+83
uinput can be too slow, leaving us with GuessDeviceNode() failing and an empty device string. Use inotify to tell us when a /dev/input/event device appeared and then continue. However, even when inotify tells us the device is there, the EVIOCGNAME may still fail on the device, so we need to keep the backup GuessDeviceNode() in place. This leaves us with a race condition - if a different device pops up while we're waiting, then we may still not get the device name. Chance of that happening is tiny. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-29test: add xserver-test to gitignorePeter Hutterer1-0/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-08-17test: add xserver test for logfile removalPeter Hutterer2-1/+67
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-17process: terminate the child if the parent diesPeter Hutterer1-0/+45
It's annoying to have the forked X server linger around when the test segfaults, so make sure we take it down with us. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-17test: add a self-check directoryPeter Hutterer3-0/+133
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>