| # 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/components.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//tools/cmc/build/expect_includes.gni") |
| |
| group("fuchsia-component-test") { |
| testonly = true |
| deps = [ |
| ":includes", |
| "realm_builder_server:realm_builder_server_component", |
| ] |
| public_deps = [ ":fuchsia-component-test-lib" ] |
| } |
| |
| rustc_library("fuchsia-component-test-lib") { |
| testonly = true |
| name = "fuchsia_component_test" |
| with_unit_tests = true |
| edition = "2021" |
| visibility = [ ":*" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.component:fuchsia.component-rustc", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl-rustc", |
| "//sdk/fidl/fuchsia.component.runner:fuchsia.component.runner-rustc", |
| "//sdk/fidl/fuchsia.component.test:fuchsia.component.test-rustc", |
| "//sdk/fidl/fuchsia.data:fuchsia.data-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/storage/vfs/rust:vfs", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/lib/cm_fidl_validator", |
| "//src/sys/lib/cm_rust", |
| "//src/sys/lib/component-events", |
| "//src/sys/lib/runner", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:maplit", |
| "//third_party/rust_crates:rand", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ |
| "src/error.rs", |
| "src/lib.rs", |
| "src/local_component_runner.rs", |
| "src/mock.rs", |
| ] |
| |
| test_deps = [ |
| "realm_builder_server:realm_builder_server_component", |
| "//examples/components/routing/fidl:echo-rustc", |
| "//sdk/fidl/fuchsia.component.config:fuchsia.component.config-rustc", |
| "//third_party/rust_crates:assert_matches", |
| ] |
| } |
| |
| expect_includes("includes") { |
| includes = [ "//sdk/lib/sys/component/realm_builder.shard.cml" ] |
| } |
| |
| fuchsia_unittest_package("fuchsia_component_test_unittests") { |
| manifest = "meta/fuchsia_component_test_tests.cml" |
| deps = [ ":fuchsia-component-test-lib_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":fuchsia_component_test_unittests", |
| "realm_builder_server:fuchsia-component-test", |
| "realm_builder_server:realm_builder_server_unit_tests", |
| "tests", |
| ] |
| } |