| # 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") |
| |
| group("logs-from-crash") { |
| testonly = true |
| deps = [ ":package" ] |
| } |
| |
| rustc_binary("logs_then_crashes") { |
| source_root = "src/logs-then-crashes.rs" |
| deps = [ |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger-rustc", |
| "//src/diagnostics/archivist:lib", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:log", |
| ] |
| sources = [ "src/logs-then-crashes.rs" ] |
| } |
| |
| fuchsia_component("logs-then-crashes") { |
| testonly = true |
| manifest = "meta/logs-then-crashes.cmx" |
| deps = [ ":logs_then_crashes" ] |
| } |
| |
| rustc_test("test") { |
| name = "logs-from-crash" |
| |
| deps = [ |
| "//src/lib/diagnostics/reader/rust", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/syslog/rust", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| ] |
| |
| sources = [ "src/lib.rs" ] |
| } |
| |
| fuchsia_component("component") { |
| testonly = true |
| component_name = "logs-from-crash" |
| manifest = "meta/logs-from-crash.cmx" |
| deps = [ |
| ":logs-then-crashes", |
| ":test", |
| ] |
| } |
| |
| # Run with fx test test-logs-from-crash |
| fuchsia_test_package("package") { |
| package_name = "test-logs-from-crash" |
| test_components = [ ":component" ] |
| } |