|  | # Copyright 2020 The Fuchsia Authors. All rights reserved. | 
|  | # Use of this source code is governed by a BSD-style license that can be | 
|  | # found in the LICENSE file. | 
|  |  | 
|  | import("//build/go/go_binary.gni") | 
|  | import("//build/go/go_library.gni") | 
|  | import("//build/go/go_test.gni") | 
|  | import("//build/go/toolchain.gni") | 
|  | import("//build/package.gni") | 
|  | import("//src/tests/benchmarks/fidl/benchmark_suite/benchmark_suite.gni") | 
|  | import("//tools/fidl/gidl/gidl.gni") | 
|  |  | 
|  | gidl_go_out_dir = "$target_gen_dir/benchmark_suite" | 
|  |  | 
|  | gidl("benchmark_suite_go") { | 
|  | testonly = true | 
|  | type = "benchmark" | 
|  | language = "go" | 
|  | inputs = benchmark_suite_gidl_files | 
|  | fidl = "//src/tests/benchmarks/fidl/benchmark_suite:benchmark_suite_fidl" | 
|  | output = "$gidl_go_out_dir/benchmark_suite.go" | 
|  | } | 
|  |  | 
|  | go_library("benchmark_suite_go_lib") { | 
|  | testonly = true | 
|  | name = "benchmark_suite" | 
|  | source_dir = gidl_go_out_dir | 
|  | non_go_deps = [ ":benchmark_suite_go" ] | 
|  | deps = [ | 
|  | "//src/lib/component", | 
|  | "//src/tests/benchmarks/fidl/benchmark_suite:benchmark_suite_fidl(${go_toolchain})", | 
|  | ] | 
|  | } | 
|  |  | 
|  | go_binary("go_fidl_microbenchmarks_bin") { | 
|  | testonly = true | 
|  | output_name = "go_fidl_microbenchmarks" | 
|  | gopackage = "go_fidl_microbenchmarks" | 
|  |  | 
|  | deps = [ ":go_fidl_microbenchmarks_lib" ] | 
|  | } | 
|  |  | 
|  | go_library("go_fidl_microbenchmarks_lib") { | 
|  | testonly = true | 
|  | name = "go_fidl_microbenchmarks" | 
|  | deps = [ | 
|  | ":benchmark_suite_go_lib", | 
|  | "//garnet/go/src/benchmarking", | 
|  | ] | 
|  | } | 
|  |  | 
|  | package("go") { | 
|  | testonly = true | 
|  | deps = [ ":go_fidl_microbenchmarks_bin" ] | 
|  |  | 
|  | binaries = [ | 
|  | { | 
|  | name = "go_fidl_microbenchmarks" | 
|  | shell = true | 
|  | }, | 
|  | ] | 
|  | } |