| # Copyright 2019 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_library.gni") |
| |
| lib_sources = [ |
| "src/diagnostics.rs", |
| "src/lib.rs", |
| ] |
| |
| lib_deps = [ |
| "//sdk/fidl/fuchsia.test.manager:fuchsia.test.manager_rust", |
| "//src/diagnostics/lib/log-command", |
| "//src/lib/diagnostics/data/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-sync", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:pin-project", |
| ] |
| |
| shared_test_deps = [ |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:pretty_assertions", |
| "//third_party/rust_crates:serde_json", |
| ] |
| |
| rustc_library("test_diagnostics") { |
| with_unit_tests = true |
| edition = "2021" |
| |
| deps = lib_deps |
| |
| if (is_fuchsia) { |
| deps += [ |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_rust", |
| "//src/lib/diagnostics/reader/rust", |
| ] |
| } |
| |
| test_deps = shared_test_deps + [ |
| "//sdk/fidl/fuchsia.mem:fuchsia.mem_rust", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| ] |
| |
| sources = lib_sources |
| } |
| |
| if (!is_fuchsia) { |
| rustc_test("test_diagnostics_host_unittests") { |
| edition = "2021" |
| sources = lib_sources |
| deps = shared_test_deps + lib_deps |
| } |
| } |
| |
| fuchsia_unittest_package("test_diagnostics_unittests") { |
| deps = [ ":test_diagnostics_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":test_diagnostics_host_unittests($host_toolchain)", |
| ":test_diagnostics_unittests", |
| ] |
| } |