blob: ada4001947b937ae5965e0e755d5c295f891bb73 [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/package.gni")
import("//build/rust/rustc_binary.gni")
import("//build/test/test_package.gni")
if (host_toolchain == current_toolchain) {
rustc_binary("blobfs-fsck-soft-host") {
testonly = true
edition = "2018"
deps = [
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:structopt",
"//tools/blackout/blackout-host",
]
source_root = "src/host.rs"
with_unit_tests = true
test_environments = [
{
dimensions = {
device_type = "Astro"
}
tags = [ "power-failure" ]
netboot = true
},
]
}
}
rustc_binary("blobfs-fsck-soft-target-bin") {
with_unit_tests = true
testonly = true
edition = "2018"
deps = [
"//src/lib/cstr",
"//src/lib/fdio/rust:fdio",
"//src/lib/scoped_task",
"//src/lib/storage/fs_management",
"//src/lib/storage/ramdevice_client",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:structopt",
"//tools/blackout/blackout-target",
]
source_root = "src/target.rs"
}
generate_manifest("blobfs.manifest") {
visibility = [ ":*" ]
args = [ "--binary=bin/blobfs" ]
}
blobfs_manifest_outputs = get_target_outputs(":blobfs.manifest")
blobfs_manifest_file = blobfs_manifest_outputs[0]
package("blobfs-fsck-soft-target") {
testonly = true
extra = [ blobfs_manifest_file ]
deps = [
":blobfs-fsck-soft-target-bin",
":blobfs.manifest",
"//zircon/system/ulib/blobfs/test:blobfs-load-generator",
]
binaries = [
{
name = "blobfs_fsck_soft_target_bin"
},
{
name = "blobfs-load-generator"
},
]
meta = [
{
path = rebase_path("meta/blobfs_fsck_soft_target.cmx")
dest = "blobfs_fsck_soft_target.cmx"
},
]
}
test_package("blobfs-fsck-soft-target-test") {
extra = [ blobfs_manifest_file ]
deps = [
":blobfs-fsck-soft-target-bin_test",
":blobfs.manifest",
"//zircon/system/ulib/blobfs/test:blobfs-load-generator",
]
binaries = [
{
name = "blobfs-load-generator"
},
]
tests = [
{
name = "blobfs_fsck_soft_target_bin_bin_test"
environment = basic_envs
},
]
}
group("blobfs-fsck-soft") {
testonly = true
public_deps = [
":blobfs-fsck-soft-host($host_toolchain)",
":blobfs-fsck-soft-target",
]
}
group("tests") {
testonly = true
public_deps = [ ":blobfs-fsck-soft-target-test" ]
}
group("integration") {
testonly = true
public_deps = [ ":blobfs-fsck-soft-host_test($host_toolchain)" ]
}