| # 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("fuchsia-inspect") { |
| version = "0.1.0" |
| edition = "2021" |
| with_unit_tests = true |
| |
| deps = [ |
| "//src/lib/diagnostics/hierarchy/rust", |
| "//src/lib/diagnostics/inspect/format/rust", |
| "//src/lib/fuchsia-async", |
| "//src/lib/injectable-time", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:derivative", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:maplit", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:paste", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| test_deps = [ |
| "//src/lib/diagnostics/testing/diagnostics-assertions/rust:diagnostics-assertions", |
| "//src/lib/fuchsia", |
| ] |
| |
| sources = [ |
| "src/health.rs", |
| "src/lib.rs", |
| "src/reader/error.rs", |
| "src/reader/mod.rs", |
| "src/reader/readable_tree.rs", |
| "src/reader/snapshot.rs", |
| "src/reader/tree_reader.rs", |
| "src/stats.rs", |
| "src/writer/error.rs", |
| "src/writer/heap.rs", |
| "src/writer/mod.rs", |
| "src/writer/state.rs", |
| "src/writer/testing_utils.rs", |
| "src/writer/types/base.rs", |
| "src/writer/types/bool_property.rs", |
| "src/writer/types/bytes_property.rs", |
| "src/writer/types/double_array.rs", |
| "src/writer/types/double_exponential_histogram.rs", |
| "src/writer/types/double_linear_histogram.rs", |
| "src/writer/types/double_property.rs", |
| "src/writer/types/inspector.rs", |
| "src/writer/types/int_array.rs", |
| "src/writer/types/int_exponential_histogram.rs", |
| "src/writer/types/int_linear_histogram.rs", |
| "src/writer/types/int_property.rs", |
| "src/writer/types/lazy_node.rs", |
| "src/writer/types/mod.rs", |
| "src/writer/types/node.rs", |
| "src/writer/types/property.rs", |
| "src/writer/types/string_array.rs", |
| "src/writer/types/string_property.rs", |
| "src/writer/types/string_reference.rs", |
| "src/writer/types/uint_array.rs", |
| "src/writer/types/uint_exponential_histogram.rs", |
| "src/writer/types/uint_linear_histogram.rs", |
| "src/writer/types/uint_property.rs", |
| "src/writer/types/value_list.rs", |
| "src/writer/utils.rs", |
| ] |
| |
| if (is_fuchsia) { |
| deps += [ |
| "//sdk/fidl/fuchsia.inspect:fuchsia.inspect_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| ] |
| |
| sources += [ "src/component.rs" ] |
| } |
| } |
| |
| fuchsia_unittest_package("fuchsia-inspect-tests") { |
| deps = [ ":fuchsia-inspect_test" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| group("host-inspect-tests") { |
| testonly = true |
| deps = [ ":fuchsia-inspect_test($host_toolchain)" ] |
| } |
| |
| group("rust") { |
| public_deps = [ ":fuchsia-inspect" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":fuchsia-inspect-tests", |
| ":host-inspect-tests", |
| "bench:tests", |
| ] |
| } |
| |
| group("benchmarks") { |
| testonly = true |
| deps = [ "bench" ] |
| } |