blob: d4d7ef1e7f130313ab9c2a4d7aff852b2c747630 [file] [log] [blame]
# 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/rust/rustc_library.gni")
import("//src/sys/build/components.gni")
rustc_library("fuchsia-archive") {
with_unit_tests = true
edition = "2018"
deps = [
"//garnet/lib/rust/io_util",
"//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:futures",
"//third_party/rust_crates:itertools",
"//third_party/rust_crates:matches",
]
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 = "2018"
deps = [
":fuchsia-archive",
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//src/lib/fuchsia-async",
"//third_party/rust_crates: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" ]
}