summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-10-09 15:55:44 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-10-10 11:15:37 +1000
commit200e0d8554f8930ac7cde839376579681140f0e6 (patch)
tree9d18b567fbae80c2a2c55bc2034f3bf20d72669a
parent18e69a49dedc0e6f0627291f04fcdeb8b187c4af (diff)
test: add test-case for starting servers
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>
-rw-r--r--test/xserver-test.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/xserver-test.cpp b/test/xserver-test.cpp
index ba6c462..103657c 100644
--- a/test/xserver-test.cpp
+++ b/test/xserver-test.cpp
@@ -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);