Skip to content

Commit

Permalink
Replace InitBenchmark with InitTest. Remove qps_test.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
yang-g committed Jul 13, 2017
1 parent ed3ad4b commit b575a34
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 75 deletions.
5 changes: 5 additions & 0 deletions test/cpp/qps/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ grpc_cc_binary(
"//:gpr",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_config",
"//test/cpp/util:test_util",
],
)
Expand All @@ -131,6 +132,7 @@ grpc_cc_test(
deps = [
":histogram",
":interarrival",
"//test/cpp/util:test_config",
],
)

Expand All @@ -141,6 +143,7 @@ grpc_cc_binary(
":benchmark_config",
":driver_impl",
"//:grpc++",
"//test/cpp/util:test_config",
],
external_deps = [
"gflags",
Expand All @@ -154,6 +157,7 @@ grpc_cc_test(
":benchmark_config",
":driver_impl",
":qps_worker_impl",
"//test/cpp/util:test_config",
],
)

Expand All @@ -164,6 +168,7 @@ grpc_cc_test(
":benchmark_config",
":driver_impl",
"//:grpc++",
"//test/cpp/util:test_config",
],
)

Expand Down
4 changes: 0 additions & 4 deletions test/cpp/qps/benchmark_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ using namespace gflags;
namespace grpc {
namespace testing {

void InitBenchmark(int* argc, char*** argv, bool remove_flags) {
ParseCommandLineFlags(argc, argv, remove_flags);
}

static std::shared_ptr<Reporter> InitBenchmarkReporters() {
auto* composite_reporter = new CompositeReporter;
if (FLAGS_enable_log_reporter) {
Expand Down
3 changes: 0 additions & 3 deletions test/cpp/qps/benchmark_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,12 @@
#define GRPC_TEST_CPP_UTIL_BENCHMARK_CONFIG_H

#include <memory>
#include <vector>

#include "test/cpp/qps/report.h"

namespace grpc {
namespace testing {

void InitBenchmark(int* argc, char*** argv, bool remove_flags);

/** Returns the benchmark Reporter instance.
*
* The returned instance will take care of generating reports for all the actual
Expand Down
3 changes: 3 additions & 0 deletions test/cpp/qps/json_run_localhost.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "src/core/lib/support/env.h"
#include "test/core/util/port.h"
#include "test/cpp/util/subprocess.h"
#include "test/cpp/util/test_config.h"

using grpc::SubProcess;

Expand Down Expand Up @@ -75,6 +76,8 @@ static void LogStatus(int status, const char* label) {
}

int main(int argc, char** argv) {
grpc::testing::InitTest(&argc, &argv, true);

register_sighandler();

std::string my_bin = argv[0];
Expand Down
3 changes: 3 additions & 0 deletions test/cpp/qps/qps_interarrival_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <grpc/support/histogram.h>

#include "test/cpp/qps/interarrival.h"
#include "test/cpp/util/test_config.h"

using grpc::testing::RandomDistInterface;
using grpc::testing::InterarrivalTimer;
Expand Down Expand Up @@ -50,6 +51,8 @@ static void RunTest(RandomDistInterface &&r, int threads, std::string title) {
using grpc::testing::ExpDist;

int main(int argc, char **argv) {
grpc::testing::InitTest(&argc, &argv, true);

RunTest(ExpDist(10.0), 5, std::string("Exponential(10)"));
return 0;
}
3 changes: 2 additions & 1 deletion test/cpp/qps/qps_json_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "test/cpp/qps/driver.h"
#include "test/cpp/qps/parse_json.h"
#include "test/cpp/qps/report.h"
#include "test/cpp/util/test_config.h"

DEFINE_string(scenarios_file, "",
"JSON file containing an array of Scenario objects");
Expand Down Expand Up @@ -219,7 +220,7 @@ static bool QpsDriver() {
} // namespace grpc

int main(int argc, char** argv) {
grpc::testing::InitBenchmark(&argc, &argv, true);
grpc::testing::InitTest(&argc, &argv, true);

bool ok = grpc::testing::QpsDriver();

Expand Down
4 changes: 2 additions & 2 deletions test/cpp/qps/qps_openloop_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

#include <grpc/support/log.h>

#include "test/core/util/test_config.h"
#include "test/cpp/qps/benchmark_config.h"
#include "test/cpp/qps/driver.h"
#include "test/cpp/qps/report.h"
#include "test/core/util/test_config.h"

namespace grpc {
namespace testing {
Expand Down Expand Up @@ -58,7 +58,7 @@ static void RunQPS() {
} // namespace grpc

int main(int argc, char** argv) {
grpc::testing::InitBenchmark(&argc, &argv, true);
grpc::testing::InitTest(&argc, &argv, true);

grpc::testing::RunQPS();

Expand Down
64 changes: 0 additions & 64 deletions test/cpp/qps/qps_test.cc

This file was deleted.

3 changes: 2 additions & 1 deletion test/cpp/qps/secure_sync_unary_ping_pong_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "test/cpp/qps/benchmark_config.h"
#include "test/cpp/qps/driver.h"
#include "test/cpp/qps/report.h"
#include "test/cpp/util/test_config.h"

namespace grpc {
namespace testing {
Expand Down Expand Up @@ -61,7 +62,7 @@ static void RunSynchronousUnaryPingPong() {
} // namespace grpc

int main(int argc, char** argv) {
grpc::testing::InitBenchmark(&argc, &argv, true);
grpc::testing::InitTest(&argc, &argv, true);

grpc::testing::RunSynchronousUnaryPingPong();

Expand Down

0 comments on commit b575a34

Please sign in to comment.