| # 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/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/test/test_package.gni") |
| |
| rustc_library("scoped_task") { |
| edition = "2018" |
| |
| deps = [ |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:libc", |
| ] |
| |
| sources = [ |
| "src/lib.rs", |
| "src/zircon.rs", |
| ] |
| } |
| |
| rustc_test("scoped_task_test") { |
| visibility = [ ":*" ] |
| edition = "2018" |
| source_root = "test/main.rs" |
| deps = [ |
| ":scoped_task", |
| "//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 = "2018" |
| 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" ] |
| } |
| |
| test_package("scoped-task-tests") { |
| deps = [ |
| ":scoped_task_test", |
| ":scoped_task_test_spawner", |
| ] |
| |
| tests = [ |
| { |
| name = "scoped_task_test" |
| }, |
| ] |
| |
| binaries = [ |
| { |
| name = "scoped_task_test_spawner" |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":scoped-task-tests" ] |
| } |