blob: 915acce7318dd5ecc7860acd684cac26a2f7fd69 [file] [log] [blame]
# 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("apidiff_test_lib") {
testonly = true
sources = [
"apidiff_test.go",
"diff_test.go",
"report_test.go",
]
deps = [
":gopkg",
"//tools/fidl/lib/fidlgen",
"//tools/fidl/lib/summarize:gopkg",
]
}
_fidlc_target = "//tools/fidl/fidlc($host_toolchain)"
_fidlc_binary = get_label_info(_fidlc_target, "root_out_dir") + "/fidlc"
go_test("apidiff_test") {
gopackages = [ "go.fuchsia.dev/fuchsia/tools/fidl/lib/apidiff" ]
args = [
"--fidlc",
rebase_path(_fidlc_binary, root_build_dir),
]
deps = [
":apidiff_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/apidiff"
sources = [
"apidiff.go",
"classification.go",
"diff.go",
"report.go",
]
deps = [
"//third_party/golibs:gopkg.in/yaml.v2",
"//tools/fidl/lib/fidlgen",
"//tools/fidl/lib/summarize:gopkg",
]
# This library is FIDL internal only.
visibility = [ "//tools/fidl/*" ]
}
} # is_host
group("apidiff") {
testonly = true
deps = [
":gopkg($host_toolchain)",
":tests",
]
}
group("tests") {
testonly = true
deps = [ ":apidiff_test($host_toolchain)" ]
}