diff options
-rw-r--r-- | src/environment.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/environment.cpp b/src/environment.cpp index 3da27cb..f4bb9e1 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -122,16 +122,22 @@ void xorg::testing::Environment::SetUp() { int status; int pid = waitpid(d_->process.Pid(), &status, WNOHANG); - if (pid == d_->process.Pid()) - throw std::runtime_error("Dummy X server failed to start, did you run as " - "root?"); - else if (pid == 0) + if (pid == d_->process.Pid()) { + std::string message; + message += "X server failed to start. Ensure that the \"dummy\" video " + "driver is installed. If the X.org server is older than 1.12, " + "tests will need to be run as root. Check "; + message += d_->path_to_log_file; + message += " for any errors"; + throw std::runtime_error(message); + } else if (pid == 0) { sleep(1); /* Give the dummy X server some time to start */ - else if (pid == -1) + } else if (pid == -1) { throw std::runtime_error("Could not get status of dummy X server " "process"); - else + } else { throw std::runtime_error("Invalid child PID returned by Process::Wait()"); + } } throw std::runtime_error("Unable to open connection to dummy X server"); |