blob: 36134c72c62aac124317d4df9a0098822fe9bd0e [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 = [
"//src/lib/fdio/rust:fdio",
"//src/lib/fuchsia-runtime",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:lazy_static",
"//third_party/rust_crates:libc",
"//third_party/rust_crates:tracing",
]
sources = [
"src/lib.rs",
"src/zircon.rs",
]
}
rustc_test("scoped_task_test") {
visibility = [ ":*" ]
edition = "2021"
source_root = "test/main.rs"
deps = [
"//src/lib/cstr",
"//src/lib/fdio/rust:fdio",
"//src/lib/fuchsia-runtime",
"//src/lib/zircon/rust:fuchsia-zircon",
]
sources = [ "test/main.rs" ]
}
rustc_binary("scoped_task_test_spawner") {
visibility = [ ":*" ]
edition = "2021"
source_root = "test/spawner.rs"
deps = [
":scoped_task",
"//src/lib/cstr",
"//src/lib/fdio/rust:fdio",
"//src/lib/fuchsia-runtime",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:argh",
]
# TODO(fxbug.dev/54531): Fix the leaks and remove this.
deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ]
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" ]
}