Virtually everyone trying the tests the first time will run into this issue
since we cannot check if the ABI for dummy and whatever else is needed
actually matches the server (well, we have a test for that, but unless you
run that one first...)

So be at least more verbose about the potential reasons and provide some
basic debugging help.

Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
---
 src/test.cpp | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/test.cpp b/src/test.cpp
index c7b69bc..a484787 100644
--- a/src/test.cpp
+++ b/src/test.cpp
@@ -50,8 +50,15 @@ void xorg::testing::Test::SetUp() {
     dpy = d_->display_string.c_str();
 
   d_->display = XOpenDisplay(dpy);
-  if (!d_->display)
-    throw std::runtime_error("Failed to open connection to display");
+  if (!d_->display) {
+    std::stringstream ss;
+    ss << "Failed to open connection to display";
+    if (dpy != NULL) ss << " " << dpy;
+    ss << ".\nThis usually means that your X server did not start properly.\n";
+    ss << "Check the log file, or set XORG_GTEST_CHILD_STDOUT to see the 
server's\n"
+          "error messages when starting.";
+    throw std::runtime_error(ss.str());
+  }
 }
 
 void xorg::testing::Test::TearDown() {
-- 
1.7.11.7

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to