blob: 3bcde70861bf7e0affaae7b574185bf6322cf090 [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/rust/rustc_library.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
rustc_library("pkgfs") {
name = "pkgfs"
with_unit_tests = true
edition = "2018"
deps = [
"//garnet/lib/rust/files_async",
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/pkg/lib/fuchsia-merkle",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:openat",
"//third_party/rust_crates:thiserror",
"//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc",
]
# FIXME(42452) this is a test-only dependency, but it must be listed here or
# the non-test library fails to link.
deps += [ "//src/lib/storage/ramdevice_client" ]
test_deps = [
"//src/sys/pkg/lib/fuchsia-pkg-testing",
"//src/sys/pkg/testing/blobfs-ramdisk",
"//src/sys/pkg/testing/pkgfs-ramdisk",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:matches",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:void",
]
}
# 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-tests") {
extra = [ blobfs_manifest ]
deps = [
":blobfs.manifest",
":pkgfs_test",
"//garnet/go/src/grand_unified_binary",
]
binaries = [
{
name = "pkgsvr"
source = "grand_unified_binary"
},
]
tests = [
{
name = "pkgfs_lib_test"
dest = "pkgfs-lib-test"
environments = basic_envs
},
]
}
group("tests") {
testonly = true
public_deps = [
":pkgfs-tests",
"//src/sys/pkg/bin/pm:pm",
]
}