| # 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/testing/test_spec.gni") |
| |
| host_test_data("empty-repo-keys") { |
| sources = [ |
| "//src/sys/pkg/tests/pkg-resolver/template/keys/root.json", |
| "//src/sys/pkg/tests/pkg-resolver/template/keys/snapshot.json", |
| "//src/sys/pkg/tests/pkg-resolver/template/keys/targets.json", |
| "//src/sys/pkg/tests/pkg-resolver/template/keys/timestamp.json", |
| ] |
| outputs = [ |
| "$root_out_dir/test_data/ffx_lib_pkg/empty-repo/keys/{{source_file_part}}", |
| ] |
| } |
| |
| host_test_data("empty-repo-metadata") { |
| 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 = "2021" |
| with_unit_tests = true |
| |
| deps = [ |
| "//src/developer/ffx/config:lib", |
| "//src/developer/ffx/lib/fidl-fuchsia-developer-ffx-ext", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:percent-encoding", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| test_deps = [ |
| "//src/lib/fuchsia-async", |
| "//third_party/rust_crates:maplit", |
| "//third_party/rust_crates:serial_test", |
| ] |
| |
| sources = [ |
| "src/config.rs", |
| "src/lib.rs", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":pkg_test($host_toolchain)" ] |
| } |