blob: 3da78992a61a3f9151e3283eb76d9e6c0559fde8 [file] [log] [blame]
# Copyright 2020 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("scoped_task") {
edition = "2021"
deps = [
"//sdk/rust/zx",
"//src/lib/fdio/rust:fdio",
"//src/lib/fuchsia-runtime",
"//third_party/rust_crates:lazy_static",
"//third_party/rust_crates:libc",
"//third_party/rust_crates:log",
]
sources = [
"src/lib.rs",
"src/zircon.rs",
]
}
rustc_test("scoped_task_test") {
visibility = [ ":*" ]
edition = "2021"
source_root = "test/main.rs"
deps = [
"//sdk/rust/zx",
"//src/lib/fdio/rust:fdio",
"//src/lib/fuchsia-runtime",
]
sources = [ "test/main.rs" ]
}
rustc_binary("scoped_task_test_spawner") {
visibility = [ ":*" ]
edition = "2021"
source_root = "test/spawner.rs"
deps = [
":scoped_task",
"//sdk/rust/zx",
"//src/lib/fdio/rust:fdio",
"//src/lib/fuchsia-runtime",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:argh",
]
sources = [ "test/spawner.rs" ]
}
fuchsia_unittest_component("scoped_task_test_cmp") {
component_name = "scoped_task_test"
deps = [ ":scoped_task_test" ]
manifest = "meta/scoped_task_test.cml"
}
fuchsia_test_package("scoped-task-tests") {
test_components = [ ":scoped_task_test_cmp" ]
deps = [ ":scoped_task_test_spawner" ]
}
group("tests") {
testonly = true
deps = [ ":scoped-task-tests" ]
}