| # Copyright 2022 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_library.gni") |
| import("//src/developer/ffx/build/ffx_tool.gni") |
| |
| rustc_library("ffx_triage_lib") { |
| version = "0.0.1" |
| edition = "2021" |
| with_unit_tests = true |
| deps = [ |
| "//sdk/fidl/fuchsia.feedback:fuchsia.feedback_rust", |
| "//src/developer/ffx/config:lib", |
| "//src/developer/ffx/lib/errors:lib", |
| "//src/developer/ffx/lib/fho:lib", |
| "//src/developer/ffx/lib/target/holders:lib", |
| "//src/developer/ffx/lib/writer:lib", |
| "//src/developer/ffx/plugins/target/snapshot:ffx_snapshot", |
| "//src/developer/ffx/plugins/target/snapshot:ffx_snapshot_args", |
| "//src/diagnostics/lib/triage", |
| "//src/diagnostics/triage:triage_app_lib", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:tempfile", |
| "//third_party/rust_crates:zip", |
| ] |
| test_deps = [ |
| "//src/developer/ffx/lib/writer:lib", |
| "//src/lib/fuchsia", |
| "//third_party/rust_crates:pretty_assertions", |
| "//third_party/rust_crates:serde_json", |
| ] |
| |
| sources = [ |
| "src/args.rs", |
| "src/config.rs", |
| "src/lib.rs", |
| "src/snapshot.rs", |
| ] |
| |
| inputs = [ |
| # Test config files. |
| "//src/diagnostics/triage/test_data/config/sample_tags.triage", |
| "//src/diagnostics/triage/test_data/config/other.triage", |
| "//src/diagnostics/triage/test_data/config/sample_bundle_files_error.json", |
| "//src/diagnostics/triage/test_data/config/error_rate.triage", |
| "//src/diagnostics/triage/test_data/config/map_fold.triage", |
| "//src/diagnostics/triage/test_data/config/sample_bundle_file_type_error.json", |
| "//src/diagnostics/triage/test_data/config/annotation_tests.triage", |
| "//src/diagnostics/triage/test_data/config/sample.triage", |
| "//src/diagnostics/triage/test_data/config/sample_bundle.json", |
| "//src/diagnostics/triage/test_data/config/log_tests.triage", |
| |
| # Test snapshot files. |
| "//src/diagnostics/triage/test_data/snapshot/annotations.json", |
| "//src/diagnostics/triage/test_data/snapshot/inspect.json", |
| |
| # Expected Structured output golden files. |
| "test_data/structured/error_rate_with_moniker_payload.golden.json", |
| "test_data/structured/included_tags_override_excludes.golden.json", |
| "test_data/structured/include_tagged_actions.golden.json", |
| "test_data/structured/annotation_test.golden.json", |
| "test_data/structured/log_tests.golden.json", |
| "test_data/structured/fail_on_missing_namespace.golden.json", |
| "test_data/structured/use_namespace_in_actions.golden.json", |
| "test_data/structured/bundle_test.golden.json", |
| "test_data/structured/exclude_actions_with_excluded_tags.golden.json", |
| "test_data/structured/use_namespace_in_metrics.golden.json", |
| "test_data/structured/annotation_test2.golden.json", |
| "test_data/structured/successfully_read_correct_files.golden.json", |
| "test_data/structured/map_fold_test.golden.json", |
| "test_data/structured/only_runs_included_actions.golden.json", |
| ] |
| } |
| |
| ffx_tool("ffx_triage") { |
| edition = "2021" |
| output_name = "ffx-triage" |
| deps = [ |
| ":ffx_triage_lib", |
| "//src/developer/ffx/lib/fho:lib", |
| "//src/lib/fuchsia-async", |
| ] |
| sources = [ "src/main.rs" ] |
| |
| sdk_target_name = "sdk" |
| sdk_category = "partner" |
| } |
| |
| group("triage") { |
| public_deps = [ |
| ":ffx_triage", |
| ":ffx_triage_host_tool", |
| ] |
| } |
| |
| group("bin") { |
| public_deps = [ ":ffx_triage_versioned" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":ffx_triage_lib_test($host_toolchain)" ] |
| } |