| # 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/components.gni") |
| import("//build/fidl/fidl.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_test.gni") |
| |
| group("non_hermetic_tests") { |
| testonly = true |
| deps = [ |
| ":base-resolver-as-a-component-resolver-tests", |
| ":base-resolver-as-a-component-resolver-tests-fxblob", |
| ] |
| } |
| |
| rustc_test("integration_test_bin") { |
| edition = "2021" |
| name = "base_resolver_integration_test_bin" |
| source_root = "integration_test.rs" |
| deps = [ |
| ":test.ping_rust", |
| "//sdk/fidl/fuchsia.component:fuchsia.component_rust", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| ] |
| sources = [ "integration_test.rs" ] |
| } |
| |
| fuchsia_component("integration-test") { |
| testonly = true |
| manifest = "meta/integration-test.cml" |
| deps = [ ":integration_test_bin" ] |
| } |
| |
| fuchsia_test_component("root") { |
| manifest = "meta/root-blobfs.cml" |
| test_type = "system" |
| } |
| |
| fuchsia_test_component("root_fxblob") { |
| manifest = "meta/root-fxblob.cml" |
| test_type = "system" |
| } |
| |
| fake_dependencies_deps = [ |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.metrics:fuchsia.metrics_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-runtime", |
| "//src/storage/lib/vfs/rust:vfs", |
| "//src/sys/pkg/lib/fuchsia-hash", |
| "//src/sys/pkg/lib/fuchsia-pkg-testing", |
| "//src/sys/pkg/lib/system-image", |
| "//src/sys/pkg/testing/blobfs-ramdisk", |
| "//src/sys/pkg/testing/mock-metrics", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| ] |
| |
| rustc_binary("fake_dependencies_fxblob_bin") { |
| edition = "2021" |
| testonly = true |
| name = "base_resolver_fake_dependencies_fxblob_bin" |
| source_root = "fake_dependencies.rs" |
| deps = fake_dependencies_deps |
| deps += [ "//src/storage/fxfs:fxfs_component" ] |
| features = [ "use_fxblob" ] |
| sources = [ "fake_dependencies.rs" ] |
| } |
| |
| fuchsia_component("fake-dependencies-fxblob") { |
| testonly = true |
| manifest = "meta/fake-dependencies-fxblob.cml" |
| deps = [ |
| ":fake_dependencies_fxblob_bin", |
| "//src/storage/testing:storage_driver_test_realm", |
| ] |
| } |
| |
| rustc_binary("fake_dependencies_bin") { |
| edition = "2021" |
| testonly = true |
| name = "base_resolver_fake_dependencies_bin" |
| source_root = "fake_dependencies.rs" |
| deps = fake_dependencies_deps |
| sources = [ "fake_dependencies.rs" ] |
| } |
| |
| fuchsia_component("fake-dependencies") { |
| testonly = true |
| manifest = "meta/fake-dependencies-blobfs.cml" |
| deps = [ |
| ":fake_dependencies_bin", |
| "//src/storage/testing:storage_driver_test_realm", |
| ] |
| } |
| |
| rustc_binary("package_directory_exposer_bin") { |
| edition = "2021" |
| testonly = true |
| name = "package_directory_exposer_bin" |
| source_root = "package_directory_exposer.rs" |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-fs", |
| "//third_party/rust_crates:futures", |
| ] |
| sources = [ "package_directory_exposer.rs" ] |
| } |
| |
| fuchsia_component("package-directory-exposer") { |
| testonly = true |
| manifest = "meta/package-directory-exposer.cml" |
| deps = [ ":package_directory_exposer_bin" ] |
| } |
| |
| rustc_binary("mock_component_bin") { |
| edition = "2021" |
| testonly = true |
| name = "base_resolver_mock_component_bin" |
| source_root = "mock_component.rs" |
| deps = [ |
| ":test.ping_rust", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//third_party/rust_crates:futures", |
| ] |
| sources = [ "mock_component.rs" ] |
| } |
| |
| rustc_binary("bridge_to_subpackaged_component_bin") { |
| edition = "2021" |
| testonly = true |
| name = "base_resolver_bridge_to_subpackaged_component_bin" |
| source_root = "bridge_to_subpackaged_component.rs" |
| deps = [ |
| ":test.ping_rust", |
| "//sdk/fidl/fuchsia.component:fuchsia.component_rust", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//third_party/rust_crates:futures", |
| ] |
| sources = [ "bridge_to_subpackaged_component.rs" ] |
| } |
| |
| fuchsia_component("mock-component") { |
| testonly = true |
| manifest = "meta/mock-component.cml" |
| deps = [ ":mock_component_bin" ] |
| } |
| |
| fuchsia_component("mock-superpackage-component") { |
| testonly = true |
| manifest = "meta/mock-superpackage-component.cml" |
| deps = [ ":bridge_to_subpackaged_component_bin" ] |
| } |
| |
| fuchsia_package("subpackaged-component") { |
| testonly = true |
| deps = [ |
| ":mock-component", |
| ":package-directory-exposer", |
| ] |
| } |
| |
| fidl("test.ping") { |
| testonly = true |
| sources = [ "ping.test.fidl" ] |
| } |
| |
| fuchsia_test_package("base-resolver-as-a-component-resolver-tests") { |
| test_components = [ ":root" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| deps = [ |
| ":fake-dependencies", |
| ":integration-test", |
| ":mock-component", |
| ":mock-superpackage-component", |
| "//src/sys/pkg/bin/pkg-cache:production-component-and-config-cpp-blobfs", |
| ] |
| |
| subpackages = [ ":subpackaged-component" ] |
| } |
| |
| fuchsia_test_package("base-resolver-as-a-component-resolver-tests-fxblob") { |
| test_components = [ ":root_fxblob" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| deps = [ |
| ":fake-dependencies-fxblob", |
| ":integration-test", |
| ":mock-component", |
| ":mock-superpackage-component", |
| "//src/sys/pkg/bin/pkg-cache:production-component-and-config-fxblob", |
| ] |
| |
| subpackages = [ ":subpackaged-component" ] |
| } |