| # 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/rust/rustc_test.gni") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| rustc_library("fuchsia-pkg-testing") { |
| version = "0.1.0" |
| edition = "2018" |
| with_unit_tests = true |
| |
| deps = [ |
| "//garnet/lib/rust/files_async", |
| "//garnet/lib/rust/io_util", |
| "//garnet/public/rust/fuchsia-hyper", |
| "//sdk/fidl/fuchsia.inspect:fuchsia.inspect-rustc", |
| "//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-url", |
| "//src/lib/http-sse:http_sse", |
| "//src/lib/inspect/rust/fuchsia-inspect", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/lib/fidl-fuchsia-pkg-ext", |
| "//src/sys/lib/fuchsia_backoff", |
| "//src/sys/pkg/lib/fuchsia-archive", |
| "//src/sys/pkg/lib/fuchsia-merkle", |
| "//src/sys/pkg/lib/fuchsia-pkg", |
| "//src/sys/pkg/lib/system-image", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:chrono", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:glob", |
| "//third_party/rust_crates:hex", |
| "//third_party/rust_crates:http", |
| "//third_party/rust_crates:hyper", |
| "//third_party/rust_crates:maplit", |
| "//third_party/rust_crates:maybe-owned", |
| "//third_party/rust_crates:openat", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:rustls", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:tempfile", |
| "//third_party/rust_crates:tokio-rustls", |
| "//third_party/rust_crates:walkdir", |
| "//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc", |
| ] |
| |
| test_deps = [ "//third_party/rust_crates:matches" ] |
| } |
| |
| rustc_test("pkgfs-test") { |
| edition = "2018" |
| source_root = "tests/pkgfs_test.rs" |
| deps = [ |
| ":fuchsia-pkg-testing", |
| "//garnet/lib/rust/io_util", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fuchsia-async", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/pkg/lib/fuchsia-merkle", |
| "//src/sys/pkg/lib/pkgfs", |
| "//src/sys/pkg/testing/blobfs-ramdisk", |
| "//src/sys/pkg/testing/pkgfs-ramdisk", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:matches", |
| "//third_party/rust_crates:openat", |
| "//third_party/rust_crates:serde_json", |
| "//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc", |
| ] |
| } |
| |
| # 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("fuchsia-pkg-testing-tests") { |
| extra = [ blobfs_manifest ] |
| deps = [ |
| ":blobfs.manifest", |
| ":fuchsia-pkg-testing_test", |
| ":pkgfs-test", |
| "//garnet/go/src/grand_unified_binary", |
| ] |
| |
| binaries = [ |
| { |
| name = "pkgsvr" |
| source = "grand_unified_binary" |
| }, |
| ] |
| |
| tests = [ |
| { |
| name = "fuchsia_pkg_testing_lib_test" |
| dest = "fuchsia-pkg-testing-tests" |
| environments = basic_envs |
| }, |
| { |
| name = "pkgfs_test" |
| dest = "pkgfs-test" |
| environments = basic_envs |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ |
| ":fuchsia-pkg-testing-tests", |
| "//src/lib/storage/ramdevice_client:ramdisk-isolated-devmgr", |
| "//src/sys/pkg/bin/pm:pm", |
| ] |
| } |