| # Copyright 2026 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. | |
| load("//build/bazel/rules/host_tests:host_rustc_test.bzl", "host_rustc_test") | |
| load("//build/bazel/rules/rust:defs.bzl", "rustc_library", "rustc_test") | |
| load("//build/bazel/rules/testing:fx_unittest_package.bzl", "fx_unittest_package") | |
| package(default_applicable_licenses = ["//:license"]) | |
| rustc_library( | |
| name = "mock-installer", | |
| srcs = ["src/lib.rs"], | |
| edition = "2024", | |
| lint_config = "//build/config/rust/lints:clippy_warn_all", | |
| visibility = [ | |
| "//src/sys/pkg/tests/omaha-client:__pkg__", | |
| "//src/sys/pkg/tests/system-update-checker:__pkg__", | |
| "//src/sys/pkg/tests/update:__pkg__", | |
| "//vendor/google:__subpackages__", | |
| ], | |
| deps = [ | |
| "//src/lib/fidl/rust/fidl", | |
| "//src/lib/fuchsia-async", | |
| "//src/lib/fuchsia-sync", | |
| "//src/sys/pkg/fidl/fuchsia.update.installer:fuchsia.update.installer_rust_flex", | |
| "//src/sys/pkg/lib/fidl-fuchsia-update-installer-ext", | |
| "//third_party/rust_crates/vendor:assert_matches", | |
| "//third_party/rust_crates/vendor:futures", | |
| "//third_party/rust_crates/vendor:pretty_assertions", | |
| ], | |
| ) | |
| rustc_library( | |
| name = "mock-installer_fdomain", | |
| srcs = ["src/lib.rs"], | |
| crate_features = ["fdomain"], | |
| edition = "2024", | |
| lint_config = "//build/config/rust/lints:clippy_warn_all", | |
| visibility = ["//src/developer/ffx/plugins/target/update:__pkg__"], | |
| deps = [ | |
| "//src/lib/fdomain/client", | |
| "//src/lib/fuchsia-async", | |
| "//src/lib/fuchsia-sync", | |
| "//src/sys/pkg/fidl/fuchsia.update.installer:fuchsia.update.installer_rust_fdomain_flex", | |
| "//src/sys/pkg/lib/fidl-fuchsia-update-installer-ext", | |
| "//third_party/rust_crates/vendor:assert_matches", | |
| "//third_party/rust_crates/vendor:futures", | |
| "//third_party/rust_crates/vendor:pretty_assertions", | |
| ], | |
| ) | |
| rustc_test( | |
| name = "mock_installer_lib_test", | |
| crate = ":mock-installer", | |
| edition = "2024", | |
| lint_config = "//build/config/rust/lints:clippy_warn_all", | |
| visibility = ["//visibility:private"], | |
| deps = [ | |
| "//sdk/fidl/fuchsia.pkg:fuchsia.pkg_rust_flex", | |
| "//src/lib/fuchsia", | |
| ], | |
| ) | |
| host_rustc_test( | |
| name = "mock-installer_fdomain_host_test", | |
| binary_name = "mock_installer_fdomain_lib_test", | |
| crate = ":mock-installer_fdomain", | |
| crate_features = ["fdomain"], | |
| edition = "2024", | |
| lint_config = "//build/config/rust/lints:clippy_warn_all", | |
| deps = [ | |
| "//sdk/fidl/fuchsia.pkg:fuchsia.pkg_rust_fdomain_flex", | |
| "//src/lib/fdomain/local", | |
| "//src/lib/fuchsia", | |
| ], | |
| ) | |
| fx_unittest_package( | |
| name = "mock-installer-tests", | |
| unit_tests = [":mock_installer_lib_test"], | |
| ) |