| # 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/config/fuchsia/target_api_level.gni") |
| import("//build/rust/rustc_library.gni") |
| |
| rustc_library("vfs") { |
| version = "0.1.0" |
| edition = "2021" |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/zircon/rust:fuchsia-zircon-status", |
| "//src/storage/lib/trace", |
| "//src/storage/lib/vfs/rust/macros", |
| "//src/storage/lib/vfs/rust/name", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:bitflags", |
| "//third_party/rust_crates:byteorder", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:itertools", |
| "//third_party/rust_crates:libc", |
| "//third_party/rust_crates:pin-project", |
| "//third_party/rust_crates:slab", |
| "//third_party/rust_crates:static_assertions", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| if (is_fuchsia) { |
| deps += [ "//src/lib/zircon/rust:fuchsia-zircon" ] |
| } |
| |
| if (is_host) { |
| # Avoid proliferation from where it is used already |
| visibility = [ |
| "../*", |
| "//sdk/lib/device-watcher/rust:*", |
| "//src/developer/ffx/playground:*", |
| "//src/developer/ffx/tools/playground:*", |
| "//src/lib/fuchsia-fs:*", |
| "//src/sys/pkg/lib/update-package:*", |
| ] |
| } |
| |
| with_unit_tests = true |
| sources = [ |
| "src/common.rs", |
| "src/directory.rs", |
| "src/directory/common.rs", |
| "src/directory/connection.rs", |
| "src/directory/dirents_sink.rs", |
| "src/directory/entry.rs", |
| "src/directory/entry_container.rs", |
| "src/directory/helper.rs", |
| "src/directory/immutable.rs", |
| "src/directory/immutable/connection.rs", |
| "src/directory/immutable/simple.rs", |
| "src/directory/immutable/simple/tests.rs", |
| "src/directory/mutable.rs", |
| "src/directory/mutable/connection.rs", |
| "src/directory/read_dirents.rs", |
| "src/directory/simple.rs", |
| "src/directory/test_utils.rs", |
| "src/directory/traversal_position.rs", |
| "src/directory/watchers.rs", |
| "src/directory/watchers/event_producers.rs", |
| "src/directory/watchers/watcher.rs", |
| "src/execution_scope.rs", |
| "src/file.rs", |
| "src/file/common.rs", |
| "src/file/connection.rs", |
| "src/file/simple.rs", |
| "src/file/simple/tests.rs", |
| "src/file/test_utils.rs", |
| "src/file/vmo.rs", |
| "src/file/vmo/tests.rs", |
| "src/lib.rs", |
| "src/node.rs", |
| "src/object_request.rs", |
| "src/path.rs", |
| "src/protocols.rs", |
| "src/pseudo_directory.rs", |
| "src/remote.rs", |
| "src/remote/tests.rs", |
| "src/service.rs", |
| "src/service/tests.rs", |
| "src/service/tests/direct_connection.rs", |
| "src/service/tests/node_reference.rs", |
| "src/symlink.rs", |
| "src/temp_clone.rs", |
| "src/test_utils.rs", |
| "src/test_utils/assertions.rs", |
| "src/test_utils/node.rs", |
| "src/test_utils/run.rs", |
| "src/token_registry.rs", |
| "src/tree_builder.rs", |
| ] |
| |
| test_deps = [ |
| "//src/lib/fuchsia", |
| "//src/testing/fidl:placeholders_rust", |
| "//third_party/rust_crates:assert_matches", |
| ] |
| } |
| |
| fuchsia_unittest_package("vfs-tests") { |
| deps = [ ":vfs_test" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":vfs-tests", |
| ":vfs_test($host_toolchain)", |
| "macros:tests", |
| "name:tests", |
| ] |
| } |