| # Copyright 2018 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/components.gni") |
| import("//build/fidl/fidl.gni") |
| import("//build/go/go_library.gni") |
| import("//build/go/go_test.gni") |
| import("//build/go/toolchain.gni") |
| |
| fidl("bindingstest") { |
| public_deps = [ "//zircon/vdso/zx" ] |
| sources = [ "test.test.fidl" ] |
| } |
| |
| go_library("component") { |
| deps = [ |
| "//sdk/fidl/fuchsia.io($go_toolchain)", |
| "//sdk/fidl/fuchsia.sys($go_toolchain)", |
| "//third_party/golibs:golang.org/x/sync", |
| ] |
| |
| sources = [ |
| "context.go", |
| "context_test.go", |
| "io.go", |
| "io_test.go", |
| "serve.go", |
| "serve_test.go", |
| ] |
| } |
| |
| go_test("component_test") { |
| gopackages = [ "go.fuchsia.dev/fuchsia/src/lib/component" ] |
| deps = [ |
| ":bindingstest($go_toolchain)", |
| ":component", |
| ] |
| } |
| |
| fuchsia_unittest_package("lib-component-go-unittests") { |
| deps = [ ":component_test" ] |
| test_specs = { |
| environments = [ emu_env ] |
| } |
| |
| # This is a test of running as a Go component, so it cannot use a v2 |
| # test runner which intercepts the directory request. |
| v2 = false |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ ":lib-component-go-unittests" ] |
| } |