X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=inline;f=libtest%2Fserver.cc;h=e554039a1c523d8dea88c4c869f89f067af85ed8;hb=77c987b7f93f71d3cca198e60538c7a75d7d11ab;hp=8ca6b53e60ee812082735ff2361f44f070ed469a;hpb=9dc6d5dd46302302b8683ed88908d7e6a86a3acf;p=m6w6%2Flibmemcached diff --git a/libtest/server.cc b/libtest/server.cc index 8ca6b53e..e554039a 100644 --- a/libtest/server.cc +++ b/libtest/server.cc @@ -138,6 +138,19 @@ bool Server::start() } Application app(executable(), is_libtool()); + + if (is_debug()) + { + app.use_gdb(); + } + else if (getenv("TESTS_ENVIRONMENT")) + { + if (strstr(getenv("TESTS_ENVIRONMENT"), "gdb")) + { + app.use_gdb(); + } + } + if (args(app) == false) { Error << "Could not build command()"; @@ -293,8 +306,7 @@ bool Server::set_log_file() int fd; if ((fd= mkstemp(file_buffer)) == -1) { - perror(file_buffer); - return false; + libtest::fatal(LIBYATL_DEFAULT_PARAM, "mkstemp() failed on %s with %s", file_buffer, strerror(errno)); } close(fd); @@ -307,13 +319,9 @@ bool Server::args(Application& app) { // Set a log file if it was requested (and we can) - if (getenv("LIBTEST_LOG") and has_log_file_option()) + if (has_log_file_option()) { - if (not set_log_file()) - { - return false; - } - + set_log_file(); log_file_option(app, _log_file); }