| # 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/rust/rustc_library.gni") |
| import("//build/testing/environments.gni") |
| |
| rustc_library("fuchsia-bootfs") { |
| name = "fuchsia_bootfs" |
| edition = "2018" |
| with_unit_tests = true |
| |
| deps = [ |
| "//src/lib/zerocopy", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:byteorder", |
| "//third_party/rust_crates:num", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| test_deps = [ "//third_party/rust_crates:lazy_static" ] |
| |
| sources = [ |
| "src/bootfs.rs", |
| "src/lib.rs", |
| ] |
| } |
| |
| resource("testdata_bootfs") { |
| sources = [ "testdata/basic.bootfs.uncompressed" ] |
| outputs = [ "data/basic.bootfs.uncompressed" ] |
| } |
| |
| resource("testdata_golden_subdir") { |
| sources = [ |
| "testdata/input/dir/empty", |
| "testdata/input/dir/lorem.txt", |
| ] |
| outputs = [ "data/golden/dir/{{source_file_part}}" ] |
| } |
| |
| resource("testdata_golden_root") { |
| sources = [ |
| "testdata/input/empty", |
| "testdata/input/random.dat", |
| "testdata/input/simple.txt", |
| ] |
| outputs = [ "data/golden/{{source_file_part}}" ] |
| } |
| |
| fuchsia_unittest_package("fuchsia-bootfs-tests") { |
| manifest = "meta/fuchsia_bootfs_lib_test.cmx" |
| deps = [ |
| ":fuchsia-bootfs_test", |
| ":testdata_bootfs", |
| ":testdata_golden_root", |
| ":testdata_golden_subdir", |
| ] |
| } |