Commit 200e0d85 authored by Peter Hutterer's avatar Peter Hutterer
Browse files

test: add test-case for starting servers



With the SIGUSR1 patch, an XOpenDisplay() after XServer::Start() should
always succeed.
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas's avatarChase Douglas <chase.douglas@ubuntu.com>
parent 18e69a49
......@@ -55,6 +55,22 @@ TEST(XServer, LogRemoval)
file.close();
}
TEST(XServer, WaitForSIGUSR1)
{
SCOPED_TRACE("TESTCASE: XOpenDisplay() following server.Start() must\n"
"succeed as we wait for the SIGUSR1 signal\n");
for (int i = 0; i < 20; i++) {
XServer server;
server.SetOption("-logfile", "/tmp/xorg-testing-xserver-sigusr1.log");
server.SetOption("-noreset", "");
server.Start();
ASSERT_EQ(server.GetState(), Process::RUNNING);
Display *dpy = XOpenDisplay(server.GetDisplayString().c_str());
ASSERT_TRUE(dpy != NULL);
XCloseDisplay(dpy);
server.Terminate(500);
}
}
int main(int argc, char *argv[]) {
testing::InitGoogleTest(&argc, argv);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment