| # Copyright 2018 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/components.gni") |
| import("//build/rust/rustc_library.gni") |
| |
| rustc_library("fuchsia-archive") { |
| with_unit_tests = true |
| edition = "2021" |
| deps = [ |
| "//src/lib/fuchsia-fs", |
| "//third_party/rust_crates:bincode", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:thiserror", |
| ] |
| test_deps = [ |
| "//src/lib/fuchsia-async", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:itertools", |
| ] |
| sources = [ |
| "src/async_read.rs", |
| "src/error.rs", |
| "src/lib.rs", |
| "src/name.rs", |
| "src/read.rs", |
| "src/write.rs", |
| ] |
| } |
| |
| rustc_test("reject-invalid-fars-test") { |
| source_root = "tests/reject_invalid_fars.rs" |
| edition = "2021" |
| deps = [ |
| ":fuchsia-archive", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-fs", |
| "//third_party/rust_crates:assert_matches", |
| ] |
| |
| sources = [ "tests/reject_invalid_fars.rs" ] |
| } |
| |
| fuchsia_unittest_component("unit-test-component") { |
| component_name = "fuchsia-archive-lib-test" |
| visibility = [ ":*" ] |
| deps = [ ":fuchsia-archive_test" ] |
| } |
| |
| fuchsia_unittest_component("invalid-fars-test-component") { |
| component_name = "reject-invalid-fars-test" |
| visibility = [ ":*" ] |
| deps = [ ":reject-invalid-fars-test" ] |
| } |
| |
| fuchsia_test_package("fuchsia-archive-tests") { |
| test_components = [ |
| ":unit-test-component", |
| ":invalid-fars-test-component", |
| ] |
| deps = [ "//src/sys/pkg/testing/invalid-fars:resource" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ |
| ":fuchsia-archive-tests", |
| ":fuchsia-archive_test($host_toolchain)", |
| ] |
| } |