| # Copyright 2022 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") |
| |
| group("storage") { |
| testonly = true |
| deps = [ |
| ":settings_storage", |
| ":tests", |
| ] |
| } |
| |
| fidl("test.storage") { |
| testonly = true |
| sources = [ "storage.test.fidl" ] |
| } |
| |
| rustc_library("settings_storage") { |
| name = "settings_storage" |
| with_unit_tests = true |
| edition = "2021" |
| |
| visibility = [ |
| ":*", |
| "//src/settings/service:*", |
| ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.stash:fuchsia.stash_rust", |
| "//src/lib/diagnostics/inspect/derive", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/settings/inspect_utils:settings_inspect_utils", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| test_deps = [ |
| ":test.storage_rust", |
| "//src/lib/diagnostics/testing/diagnostics-assertions/rust:diagnostics-assertions", |
| "//src/lib/fuchsia", |
| "//src/storage/lib/vfs/rust:vfs", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:test-case", |
| ] |
| |
| sources = [ |
| "src/device_storage.rs", |
| "src/fidl_storage.rs", |
| "src/lib.rs", |
| "src/stash_logger.rs", |
| "src/storage_factory.rs", |
| ] |
| |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| configs += [ "//build/config/rust/lints:clippy_warn_all" ] |
| } |
| |
| fuchsia_unittest_package("settings_storage_tests") { |
| component_name = "settings_storage_test" |
| manifest = "meta/settings_storage_tests.cml" |
| deps = [ ":settings_storage_test" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":settings_storage_tests" ] |
| } |