| # 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/config.gni") |
| import("//build/rust/rustc_library.gni") |
| |
| rustc_library("lib") { |
| name = "detect" |
| edition = "2021" |
| with_unit_tests = true |
| |
| visibility = [ |
| "//src/diagnostics/detect/*", |
| "//src/diagnostics/launcher/*", |
| ] |
| |
| deps = [ |
| ":triage-detect-config", |
| "//sdk/fidl/fuchsia.feedback:fuchsia.feedback_rust", |
| "//src/diagnostics/lib/inspect-fetcher", |
| "//src/diagnostics/lib/triage", |
| "//src/lib/diagnostics/inspect/derive", |
| "//src/lib/diagnostics/inspect/runtime/rust", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/injectable-time", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:glob", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_derive", |
| "//third_party/rust_crates:serde_json5", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| test_deps = [ |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:maplit", |
| ] |
| |
| sources = [ |
| "src/delay_tracker.rs", |
| "src/diagnostics.rs", |
| "src/lib.rs", |
| "src/snapshot.rs", |
| "src/triage_shim.rs", |
| ] |
| } |
| |
| fuchsia_component_manifest("triage-detect-manifest") { |
| manifest = "meta/triage_detect.cml" |
| component_name = "triage-detect" |
| } |
| |
| fuchsia_structured_config_values("triage-detect-prod-config") { |
| cm_label = ":triage-detect-manifest" |
| values_source = "configs/default.json5" |
| } |
| |
| fuchsia_structured_config_rust_lib("triage-detect-config") { |
| cm_label = ":triage-detect-manifest" |
| } |
| |
| fuchsia_component("component") { |
| cm_label = ":triage-detect-manifest" |
| deps = [ "//src/diagnostics/launcher:bin" ] |
| } |
| |
| fuchsia_package("triage-detect") { |
| deps = [ |
| ":component", |
| ":triage-detect-prod-config", |
| ] |
| } |
| |
| fuchsia_unittest_package("triage-detect-tests") { |
| deps = [ ":lib_test" ] |
| |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":triage-detect-tests", |
| "//src/diagnostics/detect/integration:tests", |
| ] |
| } |