| # 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_binary.gni") |
| import("//build/rust/rustc_test.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":component-manager-services-tests" ] |
| } |
| |
| rustc_binary("service-routing-branch-bin") { |
| output_name = "service_routing_branch_bin" |
| deps = [ |
| "//sdk/fidl/fuchsia.component:fuchsia.component-rustc", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl-rustc", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| source_root = "src/branch.rs" |
| sources = [ "src/branch.rs" ] |
| } |
| |
| fuchsia_test_component("service-routing-branch") { |
| manifest = "meta/service-routing-branch.cml" |
| restricted_features = [ "services" ] |
| deps = [ ":service-routing-branch-bin" ] |
| } |
| |
| rustc_test("service-routing-test-bin") { |
| deps = [ |
| "//examples/components/services:fuchsia.examples.services-rustc", |
| "//garnet/lib/rust/files_async", |
| "//garnet/lib/rust/io_util", |
| "//sdk/fidl/fuchsia.component:fuchsia.component-rustc", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-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-component-test", |
| "//src/sys/lib/cm_rust", |
| "//src/sys/lib/component-events", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| source_root = "src/service_routing_test.rs" |
| sources = [ "src/service_routing_test.rs" ] |
| } |
| |
| fuchsia_test_component("service-routing-test") { |
| manifest = "meta/service-routing-test.cml" |
| restricted_features = [ "services" ] |
| deps = [ ":service-routing-test-bin" ] |
| } |
| |
| rustc_test("filtered-service-routing-test-bin") { |
| deps = [ |
| "//garnet/lib/rust/files_async", |
| "//garnet/lib/rust/io_util", |
| "//sdk/fidl/fuchsia.component:fuchsia.component-rustc", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-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-component-test", |
| "//src/sys/component_manager/tests/services/src/fidl:fuchsia.examples-rustc", |
| "//src/sys/lib/cm_rust", |
| "//src/sys/lib/component-events", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:itertools", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| source_root = "src/filtered_service_routing_test.rs" |
| sources = [ "src/filtered_service_routing_test.rs" ] |
| } |
| |
| fuchsia_test_component("filtered-service-routing-test") { |
| manifest = "meta/filtered-service-routing-test.cml" |
| restricted_features = [ |
| "services", |
| "dynamic_offers", |
| ] |
| deps = [ ":filtered-service-routing-test-bin" ] |
| } |
| |
| rustc_binary("service-routing-client-bin") { |
| output_name = "service_routing_client_bin" |
| deps = [ |
| "//garnet/lib/rust/files_async", |
| "//sdk/fidl/fuchsia.component:fuchsia.component-rustc", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl-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/sys/component_manager/tests/services/src/fidl:fuchsia.examples-rustc", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| source_root = "src/service_client.rs" |
| sources = [ "src/service_client.rs" ] |
| } |
| |
| fuchsia_test_component("echo-service-client") { |
| manifest = "meta/echo-service-client.cml" |
| restricted_features = [ "services" ] |
| deps = [ ":service-routing-client-bin" ] |
| } |
| |
| rustc_binary("multi_instance_echo_service_bin") { |
| output_name = "multi_instance_echo_service_bin" |
| deps = [ |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-runtime", |
| "//src/sys/component_manager/tests/services/src/fidl:fuchsia.examples-rustc", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| source_root = "src/multi_instance_echo_service.rs" |
| sources = [ "src/multi_instance_echo_service.rs" ] |
| } |
| |
| fuchsia_test_component("multi-instance-echo-provider") { |
| manifest = "meta/multi-instance-echo-provider.cml" |
| restricted_features = [ "services" ] |
| deps = [ ":multi_instance_echo_service_bin" ] |
| } |
| |
| fuchsia_test_package("component-manager-services-tests") { |
| test_components = [ |
| ":service-routing-test", |
| ":filtered-service-routing-test", |
| ] |
| |
| deps = [ |
| ":echo-service-client", |
| ":multi-instance-echo-provider", |
| ":service-routing-branch", |
| "//examples/components/services:provider-a-cmp", |
| "//examples/components/services:provider-b-cmp", |
| ] |
| } |