| # 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/config.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/rust/rustc_test.gni") |
| import("//src/sys/build/components.gni") |
| |
| rustc_binary("bin") { |
| name = "ext4_readonly" |
| edition = "2018" |
| with_unit_tests = true |
| |
| deps = [ |
| "//garnet/lib/rust/io_util", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/storage/vfs/rust:vfs", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/storage/ext4/lib:parser", |
| "//src/storage/ext4/read-only:ext4-read-only", |
| "//src/storage/ext4/server/fidl:ext4_readonly-rustc", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| sources = [ "src/main.rs" ] |
| } |
| |
| rustc_test("ext4_server_integration_test") { |
| source_root = "tests/ext4_server_test.rs" |
| edition = "2018" |
| |
| deps = [ |
| "//garnet/lib/rust/io_util", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/storage/ext4/server/fidl:ext4_readonly-rustc", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:matches", |
| ] |
| |
| sources = [ "tests/ext4_server_test.rs" ] |
| } |
| |
| group("server") { |
| deps = [ ":ext4_readonly" ] |
| } |
| |
| fuchsia_component("ext4_readonly_comp") { |
| component_name = "ext4_readonly" |
| manifest = "meta/ext4_readonly.cmx" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("ext4_readonly") { |
| deps = [ ":ext4_readonly_comp" ] |
| } |
| |
| fuchsia_unittest_package("ext4_server_tests") { |
| deps = [ ":bin_test" ] |
| } |
| |
| fuchsia_component("ext4_server_integration_test_comp") { |
| testonly = true |
| component_name = "ext4_server_integration_test" |
| manifest = "meta/ext4_server_integration_test.cmx" |
| deps = [ ":ext4_server_integration_test" ] |
| } |
| |
| resource("ext4_server_integration_test_data") { |
| testonly = true |
| sources = [ |
| "../read-only/test_files/1file.img", |
| "../read-only/test_files/nest.img", |
| ] |
| outputs = [ "data/{{source_file_part}}" ] |
| } |
| |
| fuchsia_test_package("ext4_server_integration_tests") { |
| test_components = [ ":ext4_server_integration_test_comp" ] |
| deps = [ |
| ":ext4_readonly_comp", |
| ":ext4_server_integration_test_data", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":ext4_server_integration_tests", |
| ":ext4_server_tests", |
| ] |
| } |