| # Copyright 2019 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_library.gni") |
| import("//src/sys/core/build/core_shard.gni") |
| |
| rustc_library("test_lib") { |
| testonly = true |
| name = "test_manager_test_lib" |
| with_unit_tests = true |
| edition = "2021" |
| source_root = "src/test_lib.rs" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.test.manager:fuchsia.test.manager-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/test_diagnostics/rust:test_diagnostics", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:futures-util", |
| "//third_party/rust_crates:linked-hash-map", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ "src/test_lib.rs" ] |
| } |
| |
| rustc_library("lib") { |
| testonly = true |
| name = "test_manager_lib" |
| with_unit_tests = true |
| edition = "2021" |
| |
| # Only for internal use. |
| visibility = [ |
| ":*", |
| "tests/*", |
| ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl-rustc", |
| "//sdk/fidl/fuchsia.component.resolution:fuchsia.component.resolution-rustc", |
| "//sdk/fidl/fuchsia.component.test:fuchsia.component.test-rustc", |
| "//sdk/fidl/fuchsia.data:fuchsia.data-rustc", |
| "//sdk/fidl/fuchsia.debugdata:fuchsia.debugdata-rustc", |
| "//sdk/fidl/fuchsia.developer.remotecontrol:fuchsia.developer.remotecontrol-rustc", |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc", |
| "//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc", |
| "//sdk/fidl/fuchsia.test:fuchsia.test-rustc", |
| "//sdk/fidl/fuchsia.test.internal:fuchsia.test.internal-rustc", |
| "//sdk/fidl/fuchsia.test.manager:fuchsia.test.manager-rustc", |
| "//src/developer/remote-control/diagnostics-bridge", |
| "//src/diagnostics/archivist/fidl:controller-rustc", |
| "//src/lib/async-utils", |
| "//src/lib/diagnostics/data/rust", |
| "//src/lib/diagnostics/hierarchy/rust", |
| "//src/lib/diagnostics/inspect/contrib/rust", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/diagnostics/reader/rust", |
| "//src/lib/fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-component-test", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/fuchsia-url", |
| "//src/lib/storage/vfs/rust:vfs", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/lib/cm_moniker", |
| "//src/sys/lib/cm_rust", |
| "//src/sys/lib/mem_util", |
| "//src/sys/lib/moniker", |
| "//src/sys/lib/routing", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:futures-util", |
| "//third_party/rust_crates:glob", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:maplit", |
| "//third_party/rust_crates:rand", |
| "//third_party/rust_crates:regex", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:tracing", |
| ] |
| test_deps = [ |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:maplit", |
| ] |
| |
| sources = [ |
| "src/above_root_capabilities.rs", |
| "src/constants.rs", |
| "src/debug_data_server.rs", |
| "src/diagnostics.rs", |
| "src/enclosing_env.rs", |
| "src/error.rs", |
| "src/facet.rs", |
| "src/lib.rs", |
| "src/resolver.rs", |
| "src/run_events.rs", |
| "src/running_suite.rs", |
| "src/self_diagnostics.rs", |
| "src/test_manager_server.rs", |
| "src/test_suite.rs", |
| "src/utilities.rs", |
| ] |
| } |
| |
| rustc_binary("bin") { |
| testonly = true |
| name = "test_manager" |
| with_unit_tests = true |
| edition = "2021" |
| |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.component.resolution:fuchsia.component.resolution-rustc", |
| "//sdk/fidl/fuchsia.test.internal:fuchsia.test.internal-rustc", |
| "//src/lib/diagnostics/inspect/runtime/rust", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ "src/main.rs" ] |
| } |
| |
| fuchsia_component("test_manager_cmp") { |
| testonly = true |
| component_name = "test_manager" |
| deps = [ ":bin" ] |
| manifest = "meta/test_manager.cml" |
| } |
| |
| fuchsia_component("test_manager_for_test_cmp") { |
| testonly = true |
| component_name = "test_manager_for_tests" |
| deps = [ ":bin" ] |
| manifest = "meta/test_manager_for_tests.cml" |
| } |
| |
| fuchsia_component("memfs") { |
| testonly = true |
| deps = [ "//src/sys/component_manager/tests/memfs" ] |
| manifest = "meta/memfs.cml" |
| } |
| |
| fuchsia_package("test_manager_pkg") { |
| testonly = true |
| package_name = "test_manager" |
| deps = [ |
| ":memfs", |
| ":test_manager_cmp", |
| "cmx_runner", |
| "debug_data:debug_data_rust", |
| "debug_data_processor", |
| "//src/diagnostics/archivist:archivist-for-embedding-v2", |
| "//src/sys/early_boot_instrumentation:early-boot-instrumentation", |
| ] |
| } |
| |
| core_shard("test_manager_core_shard") { |
| shard_file = "meta/test_manager.core_shard.cml" |
| } |
| |
| fuchsia_unittest_package("test-manager-unittests") { |
| manifest = "meta/test_manager_lib_test.cml" |
| deps = [ ":lib_test" ] |
| } |
| |
| # Defines test manager and its dependencies. |
| group("test_manager") { |
| testonly = true |
| deps = [ |
| ":test_manager_pkg", |
| "//src/lib/fuchsia-component-test/realm_builder_server:fuchsia-component-test", |
| "//src/sys/test_runners", |
| "//src/sys/universe-resolver", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":test-manager-unittests", |
| "cmx_runner:tests", |
| "debug_data:tests", |
| "debug_data_processor:tests", |
| "tests", |
| ] |
| } |