summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-10-10Import googletest's fused-src filesPeter Hutterer4-0/+28702
Files taken from gtest-1.6.0.zip/fused-src, pushed into a directory layout like this: /gtest/include/gtest/gtest.h /gtest/src/gtest*.cc Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
2012-10-10Bump to 0.5.99Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-04Deprecate WaitForConnections()Daniel Martin3-32/+1
As we already know that the XServer is ready for connections due to it's notification via SIGUSR1, we don't need to poll anymore. This only deprecates the call and warns potential users, it will be removed in a future release. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-04xserver: use SIGUSR1 to wait for XServer startupDaniel Martin1-0/+31
Set the signal handler for SIGUSR1 to SIG_IGN. The XServer will test for this on startup and sends a SIGUSR1 when it's ready for connections. We wait for 1sec to receive this signal from the XServer. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-03include: fix doxygen warningPeter Hutterer1-1/+1
/home/whot/code/xorg-gtest/include/xorg/gtest/evemu/xorg-gtest-device.h:46: warning: the name `xorg-gtest_device.h' supplied as the argument of the \class, \struct, \union, or \include command is not an input file Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-03Drop compat headersPeter Hutterer6-19/+1
These headers were always internal anyway, drop them now that we've had 2 releases with them marked as deprecated. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-02xorg-gtest 0.5.0xorg-gtest-0.5.0Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-09-27process: fix compiler warningPeter Hutterer1-1/+1
../src/process.cpp: In member function ‘bool xorg::testing::Process::WaitForExit(unsigned int)’: ../src/process.cpp:130:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Matt Dew <marcoz@osource.org> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-09-27xserver: don't sleep for a second, 100us is enoughPeter Hutterer1-2/+2
But loop more often. On my machine the average wait time for the server to start up appears to be ~600 us. Play it safe, usleep for 100us only and then try again. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Matt Dew <marcoz@osource.org> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-09-27process: return if waitpid() failsPeter Hutterer1-0/+2
If the Process is forked after Start(), the child to be terminated isn't actually the child and we hang forever. Thus, treat ECHILD as success, after all if the child isn't there it can be seen as terminated. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Matt Dew <marcoz@osource.org> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-09-27process: reduce wait time for process terminationPeter Hutterer1-2/+2
Re-try with a constant 10 us until the timeout is reached instead of a timeout-dependent wait time. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Matt Dew <marcoz@osource.org> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-09-25Remove mention of "dummy" where it's not true anymorePeter Hutterer4-14/+12
These messages are not correct when the server isn't started with the dummy driver. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-29device: use inotify to wait for the device to appearPeter Hutterer5-3/+141
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-29device: if the device node is still empty when we need it, re-guessPeter Hutterer1-2/+5
Sometimes the device is there, but EVIOCGNAME fails on it and we can't guess the device node after creation time. Try again whenever we ask for the node, in the hope that enough time has passed and we may get it this time. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-29device: If we can't open the device, it's not the one we wantPeter Hutterer1-0/+3
well, or at least we're not sure whether it is, so... Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-29device: split device comparison into a helper functionPeter Hutterer1-15/+23
No functional changes, we'll re-use this though. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-29device: only strcmp if EVIOCGNAME succeedsPeter Hutterer1-2/+2
The ioctl may fail under some conditions, causing a erroneous strcmp. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-29device: move "device not found error down"Peter Hutterer1-6/+4
Even if scandir results in success, we may still fail and return an empty device path. Move the error message down, the code in between the old position of this hunk and the new position is not hit if scandir fails anyway. 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-28aclocal: set the proper include path for the default source pathPeter Hutterer1-2/+2
If a gtest source path is given, the include path is adjusted accordingly. If we fall back to the default /usr/src/gtest we only set the include path to -I/usr/src/gtest but none of the headers are there. Fix that by appending the right source path. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
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 Hutterer2-0/+50
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 Hutterer5-1/+135
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-17xserver: add RemoveLogFile()Peter Hutterer2-0/+18
Simple unlink() call to the logfile in use. The log file is only removed if the server was started and terminated or finished successfully. If it was never started or the startup failed for some reason, this function does nothing. Behaviour can be overridden by forcing the removal. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-17process: add state enum and GetState()Peter Hutterer2-0/+59
Add a set of basic states to Process to allow callers to keep track of which state a process is in (as seen from the library). This simplifies code that needs to happen on certain conditions only, e.g. log file cleanup is only needed if the process was previously started. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-17process: require NULL as last argument to Start()Peter Hutterer2-9/+13
And handle empty arguments and NULL_terminated arguments. This is a better API than require the user to pass empty strings, especially since in some cases an empty string may be a valid argument. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-17xserver: don't push the program name into the argument listPeter Hutterer1-1/+0
Process:Start() does this for us. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-17xserver: if the logfile was created by TestStartup, remove it againPeter Hutterer1-2/+12
If the file didn't exist and we created it by checking whether it is writeable, the file needs to be removed again. Otherwise we have empty logfiles lying around if the server fails to start. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-17xserver: use temporary variable for log file tooPeter Hutterer1-14/+7
And use + for string concatination, the code as-is was a legacy from const char* handling. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-16process: add XORG_GTEST_CHILD_STDOUT environment variablePeter Hutterer2-2/+7
If this variable is set, leave stdout and stderr open for the child process to see potential error messages thrown by that child. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-16Add Red Hat copyright noticesPeter Hutterer8-0/+8
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-14process: document that va_args for Start() must end with zero-length stringPeter Hutterer1-2/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-13Drop mentioning of uTouch-Evemu in comments, rename to evemuPeter Hutterer1-4/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-13xserver: add destructor to tear down the serverPeter Hutterer2-0/+7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-13xserver: add getters and setters for config and log filePeter Hutterer2-0/+24
A GetOption() call would be more generic here, but for log and config file it's more intuitive to have actual methods instead of having to pass "-config" to a generic GetOption() call. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-13Require gtest-source-path to be absolutePeter Hutterer2-5/+25
We implicitly already require this (examples/ won't build with relative paths), so make it explicit in the macros Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-08xserver: add GetVersion() to retrieve server versionPeter Hutterer2-0/+41
For non-integrated tests, knowing the X server version is important. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-08process: use fork(), not vfork()Peter Hutterer1-1/+1
From the man page: The vfork() function has the same effect as fork(2), except that the behavior is undefined if the process created by vfork() either modifies any data other than a variable of type pid_t used to store the return value from vfork(), or returns from the function in which vfork() was called, or calls any other function before successfully calling _exit(2) or one of the exec(3) family of functions. We modify data and we call functions other than _exit/exec. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2012-08-08aclocal: fill AS_IF with noop statementsPeter Hutterer1-2/+2
Expanding this macro fails when used with autoconf < v2.64. It expands to if test <condition>; then fi Empty statements are invalid. Later versions of autoconf have an explicit ':' statement to work around this issue, but for the courtesy of RHEL6 we will add it as well. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2012-07-27xserver: Pass given timeout valueOlivier Fourdan1-2/+2
WaitForDevice() can take an optional timeout parameter but that timeout should be passed down to WaitForEventOfType() and in turn to WaitForEvent() Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2012-07-26Release version 0.4.0xorg-gtest-0.4.0Chase Douglas1-1/+1
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2012-07-26Print the correct file when log file is not writeableChase Douglas1-1/+1
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2012-07-26Separate string constants so xorg-gtest_main.cpp compiles againChase Douglas1-1/+1
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2012-07-26Uninstall documentation tooChase Douglas1-0/+3
Caught by 'make distcheck'. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-07-26Disable man page documentation generation and installationChase Douglas2-5/+1
Now that we have marked some methods as deprecated, a "deprecated.3" man page is created. Since the filename isn't namespaced, it could collide with other documentation. The man pages are kinda nice, but they really aren't that useful. It's much better to use the HTML documentation. The simplest thing to do is to remove the man page generation and installation. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-07-26Disable PDF documentation generationChase Douglas1-1/+1
It's not installed and likely no one uses it. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-07-26Fix doxygen run so it works with out-of-tree buildsChase Douglas4-7/+7
Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-07-25xserver: add environment variable to suspend after startupPeter Hutterer2-0/+11
Allows for attaching gdb to a server without messing around too much in the test code. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2012-07-25xserver: check for old log file, not old config filePeter Hutterer1-1/+1
Introduced in cf9c6a9f588390869f278e5620ec40bfa2859d6a Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2012-07-20Update evemu requirement to 1.0.10Peter Hutterer1-3/+1
We need 1.0.10 for the PlayOne feature. And this means we drop utouch-evemu, latest version of that was 1.0.9. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Chase Douglas <chase.douglas@canonical.com>