From 30ecd2b8d901ddfbaa1b607fa514e96e5f49cb11 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Wed, 20 May 2015 23:06:44 -0700 Subject: [PATCH] Return shared_ptr by value plus minor dependency fix --- Makefile | 3 +++ build.json | 1 + test/cpp/qps/report.h | 2 +- test/cpp/util/benchmark_config.cc | 2 +- test/cpp/util/benchmark_config.h | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f2473f3518f..fc742bc785d 100644 --- a/Makefile +++ b/Makefile @@ -3199,6 +3199,7 @@ endif LIBGRPC++_BENCHMARK_CONFIG_SRC = \ + $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc \ test/cpp/qps/report.cc \ test/cpp/util/benchmark_config.cc \ @@ -3244,6 +3245,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBGRPC++_BENCHMARK_CONFIG_OBJS:.o=.dep) endif endif +$(OBJDIR)/$(CONFIG)/test/cpp/qps/report.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/util/benchmark_config.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc LIBGRPC++_TEST_CONFIG_SRC = \ diff --git a/build.json b/build.json index a3595f1357c..4e6accd0203 100644 --- a/build.json +++ b/build.json @@ -530,6 +530,7 @@ "build": "private", "language": "c++", "src": [ + "test/cpp/qps/qpstest.proto", "test/cpp/qps/report.cc", "test/cpp/util/benchmark_config.cc" ] diff --git a/test/cpp/qps/report.h b/test/cpp/qps/report.h index 3712f67a47b..630275ecda2 100644 --- a/test/cpp/qps/report.h +++ b/test/cpp/qps/report.h @@ -63,7 +63,7 @@ class Reporter { /** Reports QPS per core as (YYY/server core). */ virtual void ReportQPSPerCore(const ScenarioResult& result, - const ServerConfig& config) const = 0; + const ServerConfig& config) const = 0; /** Reports latencies for the 50, 90, 95, 99 and 99.9 percentiles, in ms. */ virtual void ReportLatency(const ScenarioResult& result) const = 0; diff --git a/test/cpp/util/benchmark_config.cc b/test/cpp/util/benchmark_config.cc index 1b15ddcbcc8..5b3c1daf5db 100644 --- a/test/cpp/util/benchmark_config.cc +++ b/test/cpp/util/benchmark_config.cc @@ -60,7 +60,7 @@ static std::shared_ptr InitBenchmarkReporters() { return std::shared_ptr(composite_reporter); } -const std::shared_ptr& GetReporter() { +std::shared_ptr GetReporter() { static std::shared_ptr reporter(InitBenchmarkReporters()); return reporter; } diff --git a/test/cpp/util/benchmark_config.h b/test/cpp/util/benchmark_config.h index 3a3a6d61ae6..9e98dc3550f 100644 --- a/test/cpp/util/benchmark_config.h +++ b/test/cpp/util/benchmark_config.h @@ -49,7 +49,7 @@ void InitBenchmark(int* argc, char*** argv, bool remove_flags); * The returned instane will take care of generating reports for all the actual * reporters configured via the "enable_*_reporter" command line flags (see * benchmark_config.cc). */ -const std::shared_ptr& GetReporter(); +std::shared_ptr GetReporter(); } // namespace testing } // namespace grpc