blob: e11512c220a701364c52fcb19886af13d8b70864 [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 = [
"//third_party/rust_crates:bincode",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:thiserror",
]
test_deps = [
"//third_party/rust_crates:itertools",
"//third_party/rust_crates:matches",
]
sources = [
"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",
"//third_party/rust_crates:matches",
]
sources = [ "tests/reject_invalid_fars.rs" ]
}
fuchsia_unittest_component("unit-test-component") {
component_name = "fuchsia-archive-lib-test"
executable_path = "bin/fuchsia_archive_lib_test"
visibility = [ ":*" ]
deps = [ ":fuchsia-archive_test" ]
}
fuchsia_unittest_component("invalid-fars-test-component") {
component_name = "reject-invalid-fars-test"
executable_path = "bin/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" ]
}