Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
|
|
If for some reason we fail to handle the signals, usleep for the timeout
instead. This will slow down the tests, but still behave properly. And if a
test fails with the usleep, the SCOPED_TRACE will print out the warnings.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
|
|
This changes the meaning of Process::TERMINATED to "currently in termination
but we're not sure what happened to it"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
|
|
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>
|
|
Startup failure can be a valid test-case, avoid throwing exceptions around.
Instead, update the process state on SIGCHLD, otherwise continue quietly
after the timeout.
A test that needs the server to be running, will figure out that it isn't
once XOpenDisplay() fails.
If the signal handling fails, still throw an exception, that's an actual
error case.
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>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
|
|
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>
|
|
If a process is hung and doesn't respond to termination, a Kill() call must
still try to actually kill the process. In the current code, unsuccessful
termination would still set the state, preventing Kill() from actually
working
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
|
|
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>
|
|
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>
|