X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fserver.cc;h=99991209dc2703297ec5c38838bfcb5351a511ad;hb=25efe3485198149616820ab4e52d2f18f0abe5a7;hp=78b729f96cb473faeeef973e325865cb0a28689f;hpb=23bbe3972dada1e21493437ba64be129e86b59fc;p=m6w6%2Flibmemcached diff --git a/libtest/server.cc b/libtest/server.cc index 78b729f9..99991209 100644 --- a/libtest/server.cc +++ b/libtest/server.cc @@ -111,6 +111,7 @@ bool Server::check() { _app.slurp(); _app.check(); + return true; } @@ -264,30 +265,38 @@ bool Server::start() _app.slurp(); if (kill_file(pid_file()) == false) { - throw libtest::fatal(LIBYATL_DEFAULT_PARAM, - "Failed to kill off server, waited: %u after startup occurred, when pinging failed: %.*s stderr:%.*s", - this_wait, - int(_running.size()), _running.c_str(), - int(_app.stderr_result_length()), _app.stderr_c_str()); - } + libtest::fatal err(LIBYATL_DEFAULT_PARAM, + "Failed to kill off server, waited: %u after startup occurred, when pinging failed: %.*s stderr:%.*s", + this_wait, + int(_running.size()), _running.c_str(), + int(_app.stderr_result_length()), _app.stderr_c_str()); - throw libtest::fatal(LIBYATL_DEFAULT_PARAM, - "Failed native ping(), pid: %d is alive: %s waited: %u server started, having pid_file. exec: %.*s stderr:%.*s", + stream::cerr(err.file(), err.line(), err.func()) << err.what(); + } + else + { + libtest::fatal err(LIBYATL_DEFAULT_PARAM, + "Failed native ping(), pid: %d was alive: %s waited: %u server started, having pid_file. exec: %.*s stderr:%.*s", int(_app.pid()), _app.check() ? "true" : "false", this_wait, int(_running.size()), _running.c_str(), int(_app.stderr_result_length()), _app.stderr_c_str()); + + stream::cerr(err.file(), err.line(), err.func()) << err.what(); + } } else { - throw libtest::fatal(LIBYATL_DEFAULT_PARAM, - "Failed native ping(), pid: %d is alive: %s waited: %u server started. exec: %.*s stderr:%.*s", - int(_app.pid()), - _app.check() ? "true" : "false", - this_wait, - int(_running.size()), _running.c_str(), - int(_app.stderr_result_length()), _app.stderr_c_str()); + libtest::fatal err(LIBYATL_DEFAULT_PARAM, + "Failed native ping(), pid: %d is alive: %s waited: %u server started. exec: %.*s stderr:%.*s", + int(_app.pid()), + _app.check() ? "true" : "false", + this_wait, + int(_running.size()), _running.c_str(), + int(_app.stderr_result_length()), _app.stderr_c_str()); + + stream::cerr(err.file(), err.line(), err.func()) << err.what(); } _running.clear(); return false; @@ -392,7 +401,6 @@ bool Server::set_log_file() bool Server::args(Application& app) { - // Set a log file if it was requested (and we can) if (has_log_file_option()) { @@ -430,7 +438,7 @@ bool Server::args(Application& app) port_option(app, _port); } - for (Options::const_iterator iter= _options.begin(); iter != _options.end(); iter++) + for (Options::const_iterator iter= _options.begin(); iter != _options.end(); ++iter) { if ((*iter).second.empty() == false) {