blob: 5b5b1cd5972c5d91dc18688e20732b56213508db [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/config.gni")
import("//build/package.gni")
import("//build/rust/rustc_binary.gni")
import("//build/rust/rustc_library.gni")
import("//build/rust/rustc_test.gni")
import("//build/test/test_package.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" ]
}
package("ext4_readonly") {
deps = [ ":bin" ]
binaries = [
{
name = "ext4_readonly"
},
]
meta = [
{
path = "meta/ext4_readonly.cmx"
dest = "ext4_readonly.cmx"
},
]
}
test_package("ext4_server_tests") {
deps = [ ":bin_test" ]
tests = [
{
name = "ext4_readonly_bin_test"
dest = "ext4_readonly_test"
environments = basic_envs
},
]
}
test_package("ext4_server_integration_tests") {
deps = [
":bin",
":ext4_server_integration_test",
]
binaries = [
{
name = "ext4_readonly"
},
]
meta = [
{
path = rebase_path("meta/ext4_readonly.cmx")
dest = "ext4_readonly.cmx"
},
]
resources = [
{
path = rebase_path("../read-only/test_files/1file.img")
dest = "1file.img"
},
{
path = rebase_path("../read-only/test_files/nest.img")
dest = "nest.img"
},
]
tests = [
{
name = "ext4_server_integration_test"
},
]
}
group("tests") {
testonly = true
deps = [
":ext4_server_integration_tests",
":ext4_server_tests",
]
}