| # Copyright 2019 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/fidl/fidl.gni") |
| import("//build/go/go_binary.gni") |
| import("//build/go/go_library.gni") |
| import("//build/go/go_test.gni") |
| import("//build/host.gni") |
| import("//build/testing/host_test_data.gni") |
| |
| go_library("gopkg") { |
| name = "go.fuchsia.dev/fuchsia/tools/fidl/gidl/..." |
| deps = [ "//tools/fidl/lib/fidlgen" ] |
| sources = [ |
| "config/defaults.go", |
| "dart/benchmarks.go", |
| "dart/common.go", |
| "dart/conformance.go", |
| "fuzzer_corpus/conformance.go", |
| "golang/benchmarks.go", |
| "golang/common.go", |
| "golang/conformance.go", |
| "golang/golang_test.go", |
| "hlcpp/benchmarks.go", |
| "hlcpp/builder.go", |
| "hlcpp/conformance.go", |
| "ir/error.go", |
| "ir/test_case.go", |
| "ir/util.go", |
| "ir/value.go", |
| "llcpp/benchmarks.go", |
| "llcpp/conformance.go", |
| "llcpp/lib/allocator_builder.go", |
| "llcpp/lib/common.go", |
| "llcpp/lib/unowned_builder.go", |
| "main.go", |
| "mixer/mixer.go", |
| "mixer/mixer_test.go", |
| "parser/generators.go", |
| "parser/parser.go", |
| "parser/parser_test.go", |
| "reference/benchmarks.go", |
| "rust/benchmarks.go", |
| "rust/common.go", |
| "rust/conformance.go", |
| "walker/benchmarks.go", |
| ] |
| } |
| |
| go_binary("gidl") { |
| gopackage = "go.fuchsia.dev/fuchsia/tools/fidl/gidl" |
| deps = [ ":gopkg" ] |
| } |
| |
| install_host_tools("host") { |
| deps = [ ":gidl" ] |
| outputs = [ "gidl" ] |
| } |
| |
| fidl("gidl_mixer_test_fidl") { |
| name = "test.mixer" |
| testonly = true |
| sources = [ "//tools/fidl/gidl/mixer/testdata/mixer.test.fidl" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| ":gidl_golang_test($host_toolchain)", |
| ":gidl_mixer_test($host_toolchain)", |
| ":gidl_parser_test($host_toolchain)", |
| ] |
| } |
| |
| go_test("gidl_parser_test") { |
| gopackages = [ "go.fuchsia.dev/fuchsia/tools/fidl/gidl/parser" ] |
| deps = [ |
| ":gopkg", |
| "//third_party/golibs:github.com/google/go-cmp", |
| ] |
| } |
| |
| go_test("gidl_golang_test") { |
| gopackages = [ "go.fuchsia.dev/fuchsia/tools/fidl/gidl/golang" ] |
| |
| deps = [ ":gopkg" ] |
| } |
| |
| if (is_host) { |
| host_test_data("gidl_mixer_test_json") { |
| deps = [ ":gidl_mixer_test_fidl($fidl_toolchain)" ] |
| sources = [ "$root_build_dir/fidling/gen/tools/fidl/gidl/gidl_mixer_test_fidl.fidl.json" ] |
| outputs = [ "$root_out_dir/test_data/gidl/mixer.test.fidl.json" ] |
| } |
| |
| go_test("gidl_mixer_test") { |
| gopackages = [ "go.fuchsia.dev/fuchsia/tools/fidl/gidl/mixer" ] |
| args = [ |
| "--test_data_dir", |
| rebase_path("$root_out_dir/test_data/gidl", root_build_dir), |
| ] |
| deps = [ ":gopkg" ] |
| non_go_deps = [ ":gidl_mixer_test_json" ] |
| } |
| } |