| # Copyright 2021 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_test.gni") |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ ":crash-introspect-test" ] |
| } |
| |
| rustc_binary("report_then_panic_on_start_bin") { |
| deps = [ |
| "fidl:fuchsia.test-rustc", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:tracing", |
| ] |
| name = "report_then_panic_on_start" |
| edition = "2018" |
| source_root = "report_then_panic_on_start.rs" |
| sources = [ "report_then_panic_on_start.rs" ] |
| } |
| |
| fuchsia_component("report_then_panic_on_start") { |
| deps = [ ":report_then_panic_on_start_bin" ] |
| component_name = "report_then_panic_on_start" |
| manifest = "meta/report_then_panic_on_start.cml" |
| } |
| |
| rustc_binary("panic_on_start_bin") { |
| name = "panic_on_start" |
| edition = "2018" |
| source_root = "panic_on_start.rs" |
| sources = [ "panic_on_start.rs" ] |
| } |
| |
| fuchsia_component("panic_on_start") { |
| deps = [ ":panic_on_start_bin" ] |
| component_name = "panic_on_start" |
| manifest = "meta/panic_on_start.cml" |
| } |
| |
| rustc_test("crash_introspect_test_bin") { |
| name = "crash_introspect_test" |
| edition = "2018" |
| source_root = "crash_introspect_test.rs" |
| deps = [ |
| "fidl:fuchsia.test-rustc", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-component-test", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/component_manager/testing:test_utils_lib", |
| "//src/sys/lib/component-events", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| ] |
| |
| sources = [ "crash_introspect_test.rs" ] |
| } |
| |
| fuchsia_unittest_package("crash-introspect-test") { |
| # This test aims to show that component manager behaves in a certain way when |
| # a component crashes, which requires that a component crash, which causes an |
| # (expected) error log. |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| manifest = "meta/crash_introspect_test.cml" |
| deps = [ |
| ":crash_introspect_test_bin", |
| ":report_then_panic_on_start", |
| "//src/sys/component_manager:component-manager-realm-builder-cmp", |
| ] |
| |
| #test_components = [ ":crash_introspect_test_bin" ] |
| } |