Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
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>
|
|
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>
|
|
/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>
|
|
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>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
../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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
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>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
|
|
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>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
|
|
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>
|
|
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>
|
|
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>
|
|
Process:Start() does this for us.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
|
|
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
|
|
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
|
|
Caught by 'make distcheck'.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
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>
|
|
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>
|
|
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
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>
|
|
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>
|
|
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>
|