| # Copyright 2021 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/fuchsia_unittest_component.gni") |
| import("//build/host.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/testing/host_test.gni") |
| |
| rustc_library("lib") { |
| if (is_fuchsia) { |
| # We don't want this library making it to production by accident. |
| testonly = true |
| } |
| edition = "2021" |
| deps = [ |
| "//src/lib/fuchsia-async", |
| "//src/lib/storage/storage_device", |
| "//src/storage/fxfs:lib", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:chrono", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:zstd", |
| "//third_party/zstd", |
| ] |
| sources = [ |
| "src/golden.rs", |
| "src/lib.rs", |
| "src/ops.rs", |
| ] |
| name = "tools" |
| } |
| |
| if (is_host) { |
| rustc_binary("fxfs_tool") { |
| edition = "2021" |
| deps = [ |
| ":lib", |
| "//src/lib/fuchsia-async", |
| "//src/lib/storage/storage_device", |
| "//src/storage/fxfs:lib($host_toolchain)", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:chrono", |
| "//third_party/rust_crates:log", |
| ] |
| sources = [ "src/main.rs" ] |
| output_name = "fxfs" |
| } |
| |
| host_test("fxfs_golden_image_test") { |
| binary_path = "${root_out_dir}/fxfs" |
| deps = [ |
| ":fxfs_tool($host_toolchain)", |
| "//src/storage/fxfs/testdata:golden_images", |
| ] |
| args = [ |
| "check_golden", |
| "--images-dir", |
| "fxfs_golden_images", |
| ] |
| } |
| } |
| |
| install_host_tools("tools") { |
| deps = [ ":fxfs_tool($host_toolchain)" ] |
| outputs = [ "fxfs" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":fxfs_golden_image_test($host_toolchain)" ] |
| } |