blob: eefa2ff44cb56a637f2b2b8eb9d54e84326a5bab [file] [log] [blame]
# 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_library.gni")
import("//build/go/go_test.gni")
import("//build/host.gni")
go_library("fidlgen") {
sources = [
"formatter.go",
"identifiers.go",
"lazywriter.go",
"names.go",
"reserved_names.go",
"strings.go",
"templates.go",
"types.go",
]
}
go_library("fidlgen_test_lib") {
sources = [
"identifiers_test.go",
"names_test.go",
"strings_test.go",
"types_test.go",
]
deps = [
":fidlgen",
"//tools/fidl/lib/fidlgentest",
]
}
if (is_host) {
fidlc_target = "//tools/fidl/fidlc($host_toolchain)"
fidlc_binary = get_label_info(fidlc_target, "root_out_dir") + "/fidlc"
go_test("fidlgen_lib_test") {
gopackages = [ "go.fuchsia.dev/fuchsia/tools/fidl/lib/fidlgen" ]
args = [
"--fidlc",
rebase_path(fidlc_binary, root_build_dir),
]
deps = [
":fidlgen_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 ]
}
}
group("tests") {
testonly = true
deps = [ ":fidlgen_lib_test($host_toolchain)" ]
}