| # Copyright 2024 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/components.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_test.gni") |
| |
| rustc_test("introspector_integration_test_bin") { |
| edition = "2021" |
| testonly = true |
| source_root = "src/main.rs" |
| sources = [ "src/main.rs" ] |
| deps = [ |
| "//sdk/fidl/fuchsia.component:fuchsia.component_rust", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust", |
| "//sdk/fidl/fuchsia.component.runner:fuchsia.component.runner_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-component-test", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/lib/component-events", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:futures-util", |
| ] |
| } |
| |
| rustc_binary("proxy_outgoing_to_incoming") { |
| edition = "2021" |
| testonly = true |
| source_root = "src/proxy_outgoing_to_incoming.rs" |
| sources = [ "src/proxy_outgoing_to_incoming.rs" ] |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-fs", |
| "//third_party/rust_crates:futures-util", |
| ] |
| } |
| |
| component_config("mock_runner_cm_config") { |
| sources = [ "mock_runner_cm_config.json5" ] |
| } |
| |
| fuchsia_component("component_manager_debug_with_mock_runner") { |
| testonly = true |
| deps = [ "//src/sys/component_manager:bin" ] |
| manifest = "meta/component_manager_debug_with_mock_runner.cml" |
| } |
| |
| fuchsia_component("test_root") { |
| testonly = true |
| deps = [ ":proxy_outgoing_to_incoming" ] |
| manifest = "meta/test_root.cml" |
| } |
| |
| fuchsia_component("main_realm") { |
| testonly = true |
| manifest = "meta/main_realm.cml" |
| } |
| |
| fuchsia_component("main_realm_child") { |
| testonly = true |
| manifest = "meta/simple.cml" |
| } |
| |
| fuchsia_component("unrelated_realm_child") { |
| testonly = true |
| manifest = "meta/simple.cml" |
| } |
| |
| fuchsia_component("unrelated_realm") { |
| testonly = true |
| manifest = "meta/unrelated_realm.cml" |
| } |
| |
| fuchsia_unittest_package("introspector-integration-test") { |
| manifest = "meta/introspector_integration_test.cml" |
| deps = [ |
| ":component_manager_debug_with_mock_runner", |
| ":introspector_integration_test_bin", |
| ":main_realm", |
| ":main_realm_child", |
| ":mock_runner_cm_config", |
| ":proxy_outgoing_to_incoming", |
| ":test_root", |
| ":unrelated_realm", |
| ":unrelated_realm_child", |
| ] |
| } |
| |
| rustc_test("use_introspector_disallowed_test_bin") { |
| edition = "2021" |
| testonly = true |
| source_root = "src/use_introspector_disallowed_test.rs" |
| sources = [ "src/use_introspector_disallowed_test.rs" ] |
| deps = [ |
| "//sdk/fidl/fuchsia.component:fuchsia.component_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:futures", |
| ] |
| } |
| |
| fuchsia_unittest_package("use-introspector-disallowed-test") { |
| manifest = "meta/use_introspector_disallowed_test.cml" |
| deps = [ ":use_introspector_disallowed_test_bin" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ ":introspector-integration-test" ] |
| } |