aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/util
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2017-11-20 10:50:38 -0500
committerGravatar ncteisen <ncteisen@gmail.com>2017-11-20 10:56:04 -0500
commit993e9f06921123a9220031398ecfbf52a6114dce (patch)
treef15a85d3446e8a8495e8fb5b02a1f7c4aa26c6fc /test/core/util
parent46f9175ba3a27958a1655707d6014de1ba3ce4d5 (diff)
parent9addd2eef21a96e52135dc9369566d8452412763 (diff)
Merge branch 'master' of https://github.com/grpc/grpc into no-more-extern-c
Diffstat (limited to 'test/core/util')
-rw-r--r--test/core/util/BUILD2
-rw-r--r--test/core/util/tracer_util.cc31
-rw-r--r--test/core/util/tracer_util.h32
3 files changed, 65 insertions, 0 deletions
diff --git a/test/core/util/BUILD b/test/core/util/BUILD
index 2437923435..6443553466 100644
--- a/test/core/util/BUILD
+++ b/test/core/util/BUILD
@@ -57,6 +57,7 @@ grpc_cc_library(
"reconnect_server.cc",
"slice_splitter.cc",
"test_tcp_server.cc",
+ "tracer_util.cc",
"trickle_endpoint.cc",
],
hdrs = [
@@ -69,6 +70,7 @@ grpc_cc_library(
"reconnect_server.h",
"slice_splitter.h",
"test_tcp_server.h",
+ "tracer_util.h",
"trickle_endpoint.h",
],
language = "C++",
diff --git a/test/core/util/tracer_util.cc b/test/core/util/tracer_util.cc
new file mode 100644
index 0000000000..34a132daa7
--- /dev/null
+++ b/test/core/util/tracer_util.cc
@@ -0,0 +1,31 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/util/test_config.h"
+
+#include "src/core/lib/debug/trace.h"
+
+namespace grpc_core {
+namespace testing {
+
+void grpc_tracer_enable_flag(grpc_core::TraceFlag* flag) {
+ flag->set_enabled(1);
+}
+
+} // namespace testing
+} // namespace grpc_core
diff --git a/test/core/util/tracer_util.h b/test/core/util/tracer_util.h
new file mode 100644
index 0000000000..0b432ffa46
--- /dev/null
+++ b/test/core/util/tracer_util.h
@@ -0,0 +1,32 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_TEST_CORE_UTIL_TRACER_UTIL_H
+#define GRPC_TEST_CORE_UTIL_TRACER_UTIL_H
+
+namespace grpc_core {
+class TraceFlag;
+
+namespace testing {
+// enables the TraceFlag passed to it. Used for testing purposes.
+void grpc_tracer_enable_flag(grpc_core::TraceFlag* flag);
+
+} // namespace testing
+} // namespace grpc_core
+
+#endif /* GRPC_TEST_CORE_UTIL_TRACER_UTIL_H */