| # 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/component/config.gni") |
| import("//build/fidl/fidl.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_test.gni") |
| import("//src/sys/build/components.gni") |
| import("//tools/cmc/build/cml.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":base-resolver-tests" ] |
| } |
| |
| rustc_test("integration_test_bin") { |
| name = "base_resolver_integration_test_bin" |
| source_root = "integration_test.rs" |
| deps = [ |
| ":test.ping-rustc", |
| "//garnet/lib/rust/io_util", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//third_party/rust_crates:futures", |
| ] |
| sources = [ "integration_test.rs" ] |
| } |
| |
| fuchsia_component("integration-test") { |
| testonly = true |
| manifest = "meta/integration-test.cml" |
| deps = [ ":integration_test_bin" ] |
| } |
| |
| fuchsia_component("root") { |
| testonly = true |
| manifest = "meta/root.cml" |
| } |
| |
| rustc_binary("fake_pkgfs_bin") { |
| testonly = true |
| name = "base_resolver_fake_pkgfs_bin" |
| source_root = "fake_pkgfs.rs" |
| deps = [ |
| "//garnet/lib/rust/io_util", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/syslog/rust:syslog", |
| "//src/sys/base-resolver:fake_pkgfs", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| ] |
| sources = [ "fake_pkgfs.rs" ] |
| } |
| |
| fuchsia_component("fake-pkgfs") { |
| testonly = true |
| manifest = "meta/fake-pkgfs.cml" |
| deps = [ ":fake_pkgfs_bin" ] |
| } |
| |
| rustc_binary("mock_component_bin") { |
| testonly = true |
| name = "base_resolver_mock_component_bin" |
| source_root = "mock_component.rs" |
| deps = [ |
| ":test.ping-rustc", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//third_party/rust_crates:futures", |
| ] |
| sources = [ "mock_component.rs" ] |
| } |
| |
| fuchsia_component("mock-component") { |
| testonly = true |
| manifest = "meta/mock-component.cml" |
| deps = [ ":mock_component_bin" ] |
| } |
| |
| fidl("test.ping") { |
| sources = [ "ping.test.fidl" ] |
| } |
| |
| fuchsia_test_package("base-resolver-tests") { |
| test_components = [ ":root" ] |
| deps = [ |
| ":fake-pkgfs", |
| ":integration-test", |
| ":mock-component", |
| "//src/sys/base-resolver:base-resolver-component", |
| ] |
| } |