blob: 3fd4e8522e88807dda5ad3f96c4dac9e8124c6b3 [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_library.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
rustc_library("pkgfs-ramdisk") {
version = "0.1.0"
edition = "2018"
with_unit_tests = true
deps = [
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-runtime",
"//src/lib/scoped_task",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/pkg/lib/fuchsia-merkle",
"//src/sys/pkg/lib/fuchsia-pkg",
"//src/sys/pkg/testing/blobfs-ramdisk",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:openat",
"//third_party/rust_crates:thiserror",
]
test_deps = [
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:matches",
"//third_party/rust_crates:tempfile",
]
}
# Include blobfs in the build, which comes from Zircon
generate_manifest("blobfs.manifest") {
visibility = [ ":*" ]
args = []
foreach(pattern, [ "bin/blobfs" ]) {
args += [ "--binary=" + pattern ]
}
}
blobfs_manifest_outputs = get_target_outputs(":blobfs.manifest")
blobfs_manifest = blobfs_manifest_outputs[0]
test_package("pkgfs-ramdisk-tests") {
extra = [ blobfs_manifest ]
deps = [
":blobfs.manifest",
":pkgfs-ramdisk_test",
"//garnet/go/src/grand_unified_binary",
]
binaries = [
{
name = "pkgsvr"
source = "grand_unified_binary"
},
]
tests = [
{
name = "pkgfs_ramdisk_lib_test"
dest = "pkgfs-ramdisk-lib-test"
environments = basic_envs
},
]
}
group("tests") {
testonly = true
public_deps = [
":pkgfs-ramdisk-tests",
"//src/lib/storage/ramdevice_client:ramdisk-isolated-devmgr",
]
}