blob: 96381723bc3d3008d0d662aeba7d1ba6b9633cd4 [file] [log] [blame]
# 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.gni")
import("//build/dist/resource.gni")
import("//build/rust/rustc_library.gni")
rustc_library("ext4-read-only") {
name = "ext4-read-only"
version = "0.1.0"
with_unit_tests = true
edition = "2021"
deps = [
"//third_party/rust_crates:once_cell",
"//third_party/rust_crates:static_assertions",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:tracing",
"//third_party/rust_crates:zerocopy",
]
if (is_fuchsia) {
deps += [
"//sdk/fidl/fuchsia.hardware.block:fuchsia.hardware.block_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/storage/lib/block_client/rust:remote-block-device",
"//src/storage/lib/vfs/rust:vfs",
"//third_party/rust_crates:anyhow",
]
}
test_deps = [
"//src/lib/fuchsia",
"//third_party/rust_crates:hex",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:sha2",
"//third_party/rust_crates:test-case",
]
sources = [
"src/lib.rs",
"src/parser.rs",
"src/readers.rs",
"src/structs.rs",
]
}
resource("test-images") {
sources = [
"test_files/1file.img",
"test_files/extents.img",
"test_files/longdir.img",
"test_files/nest.img",
"test_files/xattr.img",
]
outputs = [ "data/{{source_file_part}}" ]
}
fuchsia_unittest_package("ext4-read-only-tests") {
deps = [
":ext4-read-only_test",
":test-images",
]
}
group("tests") {
testonly = true
public_deps = [ ":ext4-read-only-tests" ]
}