};
}
+static std::ostream &align(std::ostream &io) {
+ return io << std::right << std::setw(8);
+}
+
int main(int argc, char *argv[]) {
client_options opt{PROGRAM_NAME, PROGRAM_VERSION, PROGRAM_DESCRIPTION};
auto concurrency = DEFAULT_CONCURRENCY;
auto total_start = time_clock::now();
std::cout << std::fixed << std::setprecision(3);
- auto align = [](std::ostream &io) -> std::ostream &{
- return io << std::right << std::setw(8);
- };
-
if (opt.isset("flush")) {
if (opt.isset("verbose")) {
std::cout << "- Flushing servers ...\n";
SECTION("with servers") {
auto test = MemcachedCluster::udp();
- auto flags = {"--binary", "--udp", "--flush", "--test=mget", "--test=get", "--tcp-nodelay",
- "--non-blocking", "--execute-number=1000"};
+ auto flags = {"--binary", "--udp", "--flush", "--test=mget", "--test=get", "--test=set",
+ "--tcp-nodelay", "--non-blocking", "--execute-number=1000"};
string servers{"--servers="};
+ auto verbosity = GENERATE(as<string>(), " --verbose ", " --quiet ");
for (const auto &server : test.cluster.getServers()) {
servers += "localhost:" + to_string(get<int>(server.getSocketOrPort())) + ", ";
}
for (const auto flag : flags) {
- REQUIRE(sh.run("memslap --quiet --concurrency=2 " + servers + flag));
+ string output;
+ REQUIRE(sh.run("memslap --concurrency=2 " + servers + verbosity + flag, output));
+ if (verbosity != " --quiet ") {
+ REQUIRE_THAT(output, Contains("Starting"));
+ REQUIRE_THAT(output, Contains("Time to"));
+ REQUIRE_THAT(output, Contains("seconds"));
+ } else {
+ REQUIRE(output.empty());
+ }
}
}
}
REQUIRE_SUCCESS(memcached_server_add(*memc, "localhost", port));
SECTION("okay") {
+ SECTION("stat") {
+ string output;
+ REQUIRE(sh.run(comm, output));
+ REQUIRE_THAT(output, Contains("Server:"));
+ REQUIRE_THAT(output, Contains("pid:"));
+ }
SECTION("version") {
REQUIRE_SUCCESS(memcached_version(*memc));
auto inst = memcached_server_instance_by_position(*memc, 0);