bool slurp();
void murder();
+ void clear()
+ {
+ slurp();
+ _stdout_buffer.clear();
+ _stderr_buffer.clear();
+ }
+
void use_gdb(bool arg)
{
_use_gdb= arg;
{
_failed++;
formatter()->failed();
- stream::make_cerr(e.file(), e.line(), e.func()) << e.what();
+ stream::make_cerr err(e.file(), e.line(), e.func());
+ err << e.what();
+ for (auto server : _frame->servers().servers)
+ {
+ auto output = server->output();
+ if (output.first.size())
+ {
+ err << "Server stdout:\n" << output.first << "\n";
+ }
+ if (output.second.size())
+ {
+ err << "Server stderr:\n" << output.second << "\n";
+ }
+ }
throw;
}
case TEST_FAILURE:
_failed++;
formatter()->failed();
+ for (auto server : _frame->servers().servers)
+ {
+ auto output = server->output();
+ if (output.first.size())
+ {
+ Out << "Server stdout:\n" << output.first << "\n";
+ }
+ if (output.second.size())
+ {
+ Out << "Server stderr:\n" << output.second << "\n";
+ }
+ }
break;
case TEST_SKIPPED:
add_option(sasl());
}
+ add_option("-vv");
+
return true;
}
#include <climits>
#include <cstdlib>
#include <iostream>
+#include <string>
#include <algorithm>
#include <functional>
bool Server::check()
{
- _app.slurp();
+ _app.clear();
return _app.check();
}
return false;
}
+std::pair<std::string, std::string> Server::output()
+{
+ _app.slurp();
+ return {
+ std::string {
+ _app.stdout_result().data(),
+ _app.stdout_result().size()
+ },
+ std::string {
+ _app.stderr_result().data(),
+ _app.stderr_result().size()
+ }
+ };
+}
+
+
} // namespace libtest
_log_file.clear();
}
+ std::pair<std::string, std::string> output();
+
pid_t pid() const;
bool has_pid() const;
std::ostream& operator<<(std::ostream& output, const libtest::vchar_t& arg)
{
- std::string tmp= libtest::printer(&arg[0], arg.size());
+ std::string tmp= libtest::printer(arg.data(), arg.size());
output << tmp << "[" << arg.size() << "]";
return output;
NULL, 0, // Zero length values
time_t(0), uint32_t(0)));
}
- //memcached_quit(memc);
+ memcached_quit(memc);
uint64_t counter= 0;
test_compare(MEMCACHED_SUCCESS,