| # 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_test.gni") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| rustc_test("driver") { |
| name = "pkg-resolver-test" |
| edition = "2018" |
| |
| deps = [ |
| "//garnet/lib/rust/fidl_fuchsia_amber_ext", |
| "//garnet/lib/rust/fidl_fuchsia_pkg_ext", |
| "//garnet/lib/rust/fuchsia_pkg_testing", |
| "//garnet/public/lib/fidl/rust/fidl", |
| "//garnet/public/rust/fdio", |
| "//garnet/public/rust/fuchsia-async", |
| "//garnet/public/rust/fuchsia-component", |
| "//garnet/public/rust/fuchsia-hyper", |
| "//garnet/public/rust/fuchsia-merkle", |
| "//garnet/public/rust/fuchsia-vfs/pseudo-fs", |
| "//garnet/public/rust/fuchsia-zircon", |
| "//sdk/fidl/fuchsia.amber:fuchsia.amber-rustc", |
| "//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc", |
| "//sdk/fidl/fuchsia.pkg.rewrite:fuchsia.pkg.rewrite-rustc", |
| "//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc", |
| "//src/sys/lib/fuchsia_url_rewrite", |
| "//third_party/rust_crates:failure", |
| "//third_party/rust_crates:futures-preview", |
| "//third_party/rust_crates:hyper", |
| "//third_party/rust_crates:matches", |
| "//third_party/rust_crates:openat", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_derive", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:tempfile", |
| "//third_party/rust_crates:void", |
| "//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc", |
| "//zircon/system/fidl/fuchsia-net:fuchsia-net-rustc", |
| "//zircon/system/fidl/fuchsia-posix-socket:fuchsia-posix-socket-rustc", |
| ] |
| } |
| |
| generate_manifest("empty-repo.manifest") { |
| visibility = [ ":*" ] |
| testonly = true |
| sources = [] |
| args = [] |
| |
| foreach( |
| path, |
| [ |
| "keys/root.json", |
| "keys/snapshot.json", |
| "keys/targets.json", |
| "keys/timestamp.json", |
| "repository/1.root.json", |
| "repository/1.snapshot.json", |
| "repository/1.targets.json", |
| "repository/81ee21fb6adeaf05df0a2d3fb0649d5387d51a09f443e91faa5fd2fda14cf930617ea9b0a5567178fc41466258e2ee0ed5f01a70e4c6f0152bc320a336868a94.targets.json", |
| "repository/d060702e3e2d3fd60317936279d72662f91edda8e44834d0a8514c6c2db3324693e0951129960b8e5e8b90b34c0f728d622b381a3780ad640251583d3ac9a2ce.snapshot.json", |
| "repository/da0704777030fb8fd545100b0246dfda48c56e780fafcda75579f6ee2178f3618084d39aad2f48d6a8b3a34e0ef422eee653c9063af5245391587e1a208b58f0.root.json", |
| "repository/root.json", |
| "repository/snapshot.json", |
| "repository/targets.json", |
| "repository/timestamp.json", |
| ]) { |
| source = "template/${path}" |
| sources += [ source ] |
| args += [ "--entry=empty-repo/${path}=" + rebase_path(source) ] |
| } |
| } |
| empty_repo_manifest_outputs = get_target_outputs(":empty-repo.manifest") |
| empty_repo_manifest_file = empty_repo_manifest_outputs[0] |
| |
| # 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_file = blobfs_manifest_outputs[0] |
| |
| test_package("pkg-resolver-tests") { |
| deps = [ |
| ":blobfs.manifest", |
| ":driver", |
| ":empty-repo.manifest", |
| "//garnet/bin/pkg_cache:bin", |
| "//garnet/bin/pkg_resolver:bin", |
| "//garnet/go/src/grand_unified_binary", |
| ] |
| |
| extra = [ |
| blobfs_manifest_file, |
| empty_repo_manifest_file, |
| ] |
| |
| binaries = [ |
| { |
| name = "amber" |
| source = "grand_unified_binary" |
| }, |
| { |
| name = "pkg_cache" |
| source = "pkg_cache" |
| }, |
| { |
| name = "pkg_resolver" |
| source = "pkg_resolver" |
| }, |
| { |
| name = "pkgsvr" |
| source = "grand_unified_binary" |
| }, |
| ] |
| |
| meta = [ |
| { |
| path = rebase_path( |
| "//garnet/go/src/amber/meta/amber_with_isolated_storage.cmx") |
| dest = "amber.cmx" |
| }, |
| { |
| path = rebase_path( |
| "//garnet/bin/pkg_cache/meta/pkg_cache_integration_test.cmx") |
| dest = "pkg_cache.cmx" |
| }, |
| { |
| path = rebase_path( |
| "//garnet/bin/pkg_resolver/meta/pkg_resolver_integration_test.cmx") |
| dest = "pkg_resolver.cmx" |
| }, |
| ] |
| |
| tests = [ |
| { |
| name = "pkg_resolver_test" |
| dest = "pkg-resolver-test" |
| environments = basic_envs |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ |
| ":pkg-resolver-tests", |
| "//garnet/go/src/pm:pm", |
| ] |
| } |