| # Copyright 2023 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_library.gni") |
| import("//src/storage/testing/driver_test_realm.gni") |
| |
| rustc_library("blob-writer") { |
| edition = "2021" |
| version = "0.1.0" |
| with_unit_tests = true |
| deps = [ |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/storage/fxfs/fidl/fuchsia.fxfs:fuchsia.fxfs_rust", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| test_deps = [ |
| "//src/lib/fuchsia", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:rand", |
| ] |
| |
| sources = [ |
| "src/errors.rs", |
| "src/lib.rs", |
| ] |
| |
| visibility = [ |
| "//src/storage/*", |
| "//src/sys/lib/fidl-fuchsia-pkg-ext/*", |
| "//src/sys/pkg/*", |
| ] |
| } |
| |
| fuchsia_unittest_package("blob-writer-unittests") { |
| deps = [ ":blob-writer_test" ] |
| } |
| |
| rustc_test("blob-writer-test") { |
| edition = "2021" |
| deps = [ |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//src/storage/fxfs/fidl/fuchsia.fxfs:fuchsia.fxfs_rust", |
| "//src/storage/lib/blob_writer:blob-writer", |
| "//src/storage/lib/delivery_blob", |
| "//src/storage/lib/fs_management/rust:fs_management", |
| "//src/storage/lib/ramdevice_client/rust:ramdevice_client", |
| "//src/sys/pkg/lib/fuchsia-merkle", |
| "//third_party/rust_crates:rand", |
| ] |
| sources = [ "tests/lib.rs" ] |
| source_root = "tests/lib.rs" |
| } |
| |
| storage_driver_test_realm_v2_component("blob-writer-test-component") { |
| component_name = "blob-writer-test-component" |
| manifest = "meta/blob_writer_test.cml" |
| deps = [ |
| ":blob-writer-test", |
| "//src/storage/fxfs:fxfs_component", |
| "//src/storage/fxfs:test_fxfs_component_manifest_shard", |
| ] |
| } |
| |
| fuchsia_test_package("blob-writer-integration-tests") { |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| test_components = [ ":blob-writer-test-component" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":blob-writer-integration-tests", |
| ":blob-writer-unittests", |
| ] |
| } |