| # 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/host.gni") |
| |
| go_library("lib") { |
| deps = [ |
| "//third_party/golibs:github.com/golang/glog", |
| "//third_party/golibs:github.com/google/go-cmp", |
| "//third_party/golibs:github.com/pkg/sftp", |
| "//third_party/golibs:golang.org/x/crypto", |
| "//tools/qemu", |
| ] |
| sources = [ |
| "api.go", |
| "api_test.go", |
| "build.go", |
| "build_mock_test.go", |
| "build_test.go", |
| "command.go", |
| "command_mock_test.go", |
| "connector.go", |
| "connector_mock_test.go", |
| "connector_test.go", |
| "e2e_test.go", |
| "ffx_command.go", |
| "ffx_fuzz_fake_test.go", |
| "fs_interface.go", |
| "fuzzer.go", |
| "fuzzer_test.go", |
| "handle.go", |
| "handle_test.go", |
| "instance.go", |
| "instance_test.go", |
| "launcher.go", |
| "launcher_mock_test.go", |
| "launcher_test.go", |
| "process.go", |
| "process_test.go", |
| "ssh_fake_test.go", |
| "test_utils_test.go", |
| "utils.go", |
| "utils_test.go", |
| ] |
| } |
| |
| # This tool can only be built on the host. |
| # Also, only the Linux build is used by ClusterFuzz, so others are disabled to |
| # work around a flake on macOS (see https://fxbug.dev/42159431). |
| if (is_linux) { |
| go_library("main") { |
| source_dir = "cmd" |
| deps = [ ":lib" ] |
| sources = [ "fuzz.go" ] |
| } |
| |
| go_binary("undercoat") { |
| library = ":main" |
| } |
| |
| install_host_tools("undercoat_tool") { |
| deps = [ ":undercoat" ] |
| outputs = [ "undercoat" ] |
| } |
| |
| go_test("undercoat_tests") { |
| library = ":lib" |
| } |
| } |
| |
| group("host_tests") { |
| visibility = [ ":*" ] |
| testonly = true |
| |
| # Tests that shouldn't be built on macOS (https://fxbug.dev/42159431) |
| if (is_linux) { |
| deps = [ ":undercoat_tests" ] |
| } |
| } |
| |
| group("host_tools") { |
| # The tool shouldn't be built on macOS (https://fxbug.dev/42159431) |
| if (is_linux) { |
| deps = [ ":undercoat_tool" ] |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":host_tests($host_toolchain)" ] |
| } |
| |
| group("fuzz") { |
| deps = [ ":host_tools($host_toolchain)" ] |
| } |