blob: b44761590833650fafe037a593842785184ca186 [file] [log] [blame]
# Copyright 2021 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/rust/rustc_test.gni")
import("//build/testing/test_spec.gni")
host_test_data("empty-repo") {
sources = [
"//src/sys/pkg/tests/pkg-resolver/template/repository/1.root.json",
"//src/sys/pkg/tests/pkg-resolver/template/repository/1.snapshot.json",
"//src/sys/pkg/tests/pkg-resolver/template/repository/1.targets.json",
"//src/sys/pkg/tests/pkg-resolver/template/repository/root.json",
"//src/sys/pkg/tests/pkg-resolver/template/repository/snapshot.json",
"//src/sys/pkg/tests/pkg-resolver/template/repository/targets.json",
"//src/sys/pkg/tests/pkg-resolver/template/repository/timestamp.json",
]
outputs = [ "$root_out_dir/test_data/ffx_lib_pkg/empty-repo/repository/{{source_file_part}}" ]
}
rustc_library("pkg") {
name = "pkg"
edition = "2018"
with_unit_tests = true
deps = [
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.developer.ffx:fuchsia.developer.ffx-rustc",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc",
"//src/developer/ffx/config:lib",
"//src/developer/ffx/lib/errors:lib",
"//src/developer/ffx/lib/fidl-fuchsia-developer-ffx-ext",
"//src/developer/ffx/lib/timeout:lib",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-hyper",
"//src/lib/http-sse:http_sse",
"//src/sys/pkg/lib/far/rust:fuchsia-archive",
"//src/sys/pkg/lib/fuchsia-pkg",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-fs",
"//third_party/rust_crates:async-lock",
"//third_party/rust_crates:async-net",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:bytes",
"//third_party/rust_crates:camino",
"//third_party/rust_crates:chrono",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:futures-lite",
"//third_party/rust_crates:home",
"//third_party/rust_crates:hyper",
"//third_party/rust_crates:log",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:notify",
"//third_party/rust_crates:parking_lot",
"//third_party/rust_crates:percent-encoding",
"//third_party/rust_crates:pin-project",
"//third_party/rust_crates:ring",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:serial_test",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:tokio",
"//third_party/rust_crates:tuf",
"//third_party/rust_crates:url",
"//third_party/rust_crates:walkdir",
]
test_deps = [
":empty-repo",
"//src/sys/pkg/lib/fuchsia-pkg",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:pretty_assertions",
"//third_party/rust_crates:tempfile",
]
sources = [
"src/config.rs",
"src/lib.rs",
"src/repository.rs",
"src/repository/file_system.rs",
"src/repository/http_repository.rs",
"src/repository/manager.rs",
"src/repository/pm.rs",
"src/repository/server.rs",
"src/test_utils.rs",
]
}
group("tests") {
testonly = true
deps = [ ":pkg_test($host_toolchain)" ]
}