Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: components/tracing/BUILD.gn

Issue 2147613002: Skeleton for proto_zero_plugin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: style and naming Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/tracing.gyp ('k') | components/tracing/test/example_messages.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/tracing/BUILD.gn
diff --git a/components/tracing/BUILD.gn b/components/tracing/BUILD.gn
index ecd3536e4fa0b3f947a3ec801a2325d16311ecd5..8f066a56d8d584e9ded9d3945459680ad5c14622 100644
--- a/components/tracing/BUILD.gn
+++ b/components/tracing/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//third_party/protobuf/proto_library.gni")
+
component("tracing") {
sources = [
"child/child_memory_dump_manager_delegate_impl.cc",
@@ -52,6 +54,38 @@ component("startup_tracing") {
]
}
+# For unit testing of generated stubs.
+proto_library("proto_zero_testing_messages") {
+ visibility = [ "//components/tracing/*" ]
+
+ sources = [
+ "test/example_messages.proto",
+ ]
+
+ generator_plugin_label = "tools/proto_zero_plugin:proto_zero_plugin"
+ generator_plugin_suffix = ".pbzero"
+ generate_cc = false
+ generate_python = false
+
+ # TODO(kraynov) Move away this complex path evaluation and dependency
+ # injection to proto_library.gni. All lines below should be removed.
+ # The problem is that root_out_dir and root_build_dir may differ in case of
+ # cross compilation. Also .exe will be appended on Windows.
+
+ plugin_host_label = generator_plugin_label + "($host_toolchain)"
+ generator_plugin =
+ rebase_path(get_label_info(plugin_host_label, "root_out_dir") + "/" +
+ get_label_info(plugin_host_label, "name"),
+ root_build_dir)
+ if (is_win) {
+ generator_plugin += ".exe"
+ }
+
+ deps = [
+ plugin_host_label,
+ ]
+}
+
source_set("unit_tests") {
testonly = true
@@ -63,9 +97,11 @@ source_set("unit_tests") {
"core/scattered_stream_writer_unittest.cc",
"core/trace_ring_buffer_unittest.cc",
"test/fake_scattered_buffer.cc",
+ "test/proto_zero_generation_unittest.cc",
]
deps = [
+ ":proto_zero_testing_messages",
":tracing",
"//base/test:test_support",
"//ipc",
« no previous file with comments | « components/tracing.gyp ('k') | components/tracing/test/example_messages.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698