blob: fee4f13595ad89e75ef9ee595d3039da0c7e6b9a [file] [log] [blame]
# Copyright 2017 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_binary.gni")
import("//build/rust/rustc_library.gni")
rustc_library("fdio") {
with_unit_tests = true
version = "0.2.0"
edition = "2021"
deps = [
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//sdk/lib/fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-runtime",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:bitflags",
"//third_party/rust_crates:thiserror",
]
test_deps = [
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-runtime",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:libc",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:tempfile",
]
sources = [
"src/fdio_sys.rs",
"src/lib.rs",
"src/spawn_builder.rs",
]
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
rustc_binary("spawn_test_target") {
version = "0.2.0"
edition = "2021"
source_root = "test/spawn_test_target.rs"
sources = [ "test/spawn_test_target.rs" ]
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
rustc_binary("spawn_builder_test_target") {
edition = "2021"
visibility = [ ":*" ]
source_root = "test/spawn_builder_test_target.rs"
sources = [ "test/spawn_builder_test_target.rs" ]
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
fuchsia_component("test-component") {
testonly = true
visibility = [ ":*" ]
component_name = "fdio_lib_test"
deps = [
":fdio_test",
":spawn_builder_test_target",
":spawn_test_target",
]
manifest = "meta/fdio_lib_test.cml"
}
fuchsia_test_package("test-package") {
package_name = "fdio-rust-tests"
test_components = [ ":test-component" ]
}
group("tests") {
testonly = true
deps = [ ":test-package" ]
}