<div>Well, I've never used stringstream, so:</div><div><br></div>Acked-by: Daniel Stone <<a href="mailto:daniel@fooishbar.org">daniel@fooishbar.org</a>><div class="gmail_extra"><br><br><div class="gmail_quote">On 6 November 2012 12:28, Peter Hutterer <span dir="ltr"><<a href="mailto:peter.hutterer@who-t.net" target="_blank">peter.hutterer@who-t.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Virtually everyone trying the tests the first time will run into this issue<br>
since we cannot check if the ABI for dummy and whatever else is needed<br>
actually matches the server (well, we have a test for that, but unless you<br>
run that one first...)<br>
<br>
So be at least more verbose about the potential reasons and provide some<br>
basic debugging help.<br>
<br>
Signed-off-by: Peter Hutterer <<a href="mailto:peter.hutterer@who-t.net">peter.hutterer@who-t.net</a>><br>
---<br>
src/test.cpp | 11 +++++++++--<br>
1 file changed, 9 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/test.cpp b/src/test.cpp<br>
index c7b69bc..a484787 100644<br>
--- a/src/test.cpp<br>
+++ b/src/test.cpp<br>
@@ -50,8 +50,15 @@ void xorg::testing::Test::SetUp() {<br>
dpy = d_->display_string.c_str();<br>
<br>
d_->display = XOpenDisplay(dpy);<br>
- if (!d_->display)<br>
- throw std::runtime_error("Failed to open connection to display");<br>
+ if (!d_->display) {<br>
+ std::stringstream ss;<br>
+ ss << "Failed to open connection to display";<br>
+ if (dpy != NULL) ss << " " << dpy;<br>
+ ss << ".\nThis usually means that your X server did not start properly.\n";<br>
+ ss << "Check the log file, or set XORG_GTEST_CHILD_STDOUT to see the server's\n"<br>
+ "error messages when starting.";<br>
+ throw std::runtime_error(ss.str());<br>
+ }<br>
}<br>
<br>
void xorg::testing::Test::TearDown() {<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.11.7<br>
<br>
</font></span></blockquote></div><br></div>