| # Copyright 2021 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_library.gni") |
| import("//build/go/go_test.gni") |
| import("//build/host.gni") |
| |
| if (is_host) { |
| go_library("summarize_test_lib") { |
| testonly = true |
| sources = [ |
| "elementslice_test.go", |
| "summary_test.go", |
| "wraparoundtype_test.go", |
| ] |
| deps = [ ":gopkg" ] |
| } |
| |
| _fidlc_target = "//tools/fidl/fidlc($host_toolchain)" |
| _fidlc_binary = get_label_info(_fidlc_target, "root_out_dir") + "/fidlc" |
| |
| go_test("summarize_test") { |
| gopackages = [ "go.fuchsia.dev/fuchsia/tools/fidl/lib/summarize" ] |
| args = [ |
| "--fidlc", |
| rebase_path(_fidlc_binary, root_build_dir), |
| ] |
| deps = [ |
| ":summarize_test_lib", |
| "//third_party/golibs:github.com/google/go-cmp", |
| "//tools/fidl/lib/fidlgentest", |
| ] |
| non_go_deps = [ ":copy_fidlc" ] |
| } |
| |
| host_test_data("copy_fidlc") { |
| sources = [ _fidlc_binary ] |
| deps = [ _fidlc_target ] |
| } |
| |
| go_library("gopkg") { |
| name = "go.fuchsia.dev/fuchsia/tools/fidl/lib/summarize/..." |
| sources = [ |
| "aliases.go", |
| "bits.go", |
| "consts.go", |
| "elementslice.go", |
| "elementstr.go", |
| "enums.go", |
| "library.go", |
| "properties.go", |
| "protocol.go", |
| "summary.go", |
| "wraparoundtype.go", |
| ] |
| deps = [ "//tools/fidl/lib/fidlgen" ] |
| |
| # This library is FIDL internal only. |
| visibility = [ "//tools/fidl/*" ] |
| } |
| } # is_host |
| |
| group("summarize") { |
| testonly = true |
| deps = [ |
| ":gopkg($host_toolchain)", |
| ":tests", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":summarize_test($host_toolchain)" ] |
| } |