| # Copyright 2026 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. | |
| load( | |
| "//build/bazel/rules/components:fx_component.bzl", | |
| "fx_component_manifest", | |
| "fx_test_component", | |
| ) | |
| load("//build/bazel/rules/packages:fx_package.bzl", "fx_package") | |
| load( | |
| "//build/bazel/rules/packages:fx_packaged_binary.bzl", | |
| "fx_packaged_binary", | |
| ) | |
| load("//build/bazel/rules/rust:rustc_library.bzl", "rustc_library") | |
| load("//build/bazel/rules/rust:rustc_test.bzl", "rustc_test") | |
| load("//build/bazel/rules/testing:fx_test.bzl", "fx_test") | |
| package(default_applicable_licenses = ["//:license"]) | |
| test_suite( | |
| name = "tests", | |
| tests = [":task-exceptions-test"], | |
| visibility = ["//src/sys:__pkg__"], | |
| ) | |
| rustc_library( | |
| name = "task-exceptions", | |
| srcs = ["src/lib.rs"], | |
| edition = "2024", | |
| visibility = [ | |
| "//src/devices/bin/driver-host:__pkg__", | |
| "//src/sys/lib/elf_runner:__pkg__", | |
| ], | |
| deps = [ | |
| "//sdk/rust/zx", | |
| "//src/lib/fuchsia-async", | |
| "//third_party/rust_crates/vendor:futures", | |
| ], | |
| ) | |
| rustc_test( | |
| name = "task-exceptions_test", | |
| crate = ":task-exceptions", | |
| crate_name = "task_exceptions_lib_test", | |
| edition = "2024", | |
| deps = [ | |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", | |
| "//sdk/fidl/fuchsia.process:fuchsia.process_rust", | |
| "//src/lib/fuchsia", | |
| "//src/lib/fuchsia-component", | |
| "//src/lib/fuchsia-fs", | |
| "//src/lib/fuchsia-runtime", | |
| "//src/sys/lib/library_loader", | |
| "//third_party/rust_crates/vendor:anyhow", | |
| ], | |
| ) | |
| fx_packaged_binary( | |
| name = "task-exceptions_test_packaged_bin", | |
| testonly = True, | |
| binary = ":task-exceptions_test", | |
| binary_name = "task_exceptions_lib_test", | |
| ) | |
| fx_component_manifest( | |
| name = "task-exceptions-cmp-manifest", | |
| testonly = True, | |
| component_name = "task-exceptions-tests", | |
| includes = [ | |
| "//sdk/lib/syslog:client.shard", | |
| "//src/sys/test_runners/rust:default.shard.cml", | |
| ], | |
| manifest = "meta/task-exceptions-tests.cml", | |
| ) | |
| fx_test_component( | |
| name = "task-exceptions-cmp", | |
| compiled_manifest = ":task-exceptions-cmp-manifest", | |
| deps = [":task-exceptions_test_packaged_bin"], | |
| ) | |
| fx_package( | |
| name = "task-exceptions-tests", | |
| components = ["//src/sys/component_manager/tests/crash_introspect:panic_on_start"], | |
| test_components = [":task-exceptions-cmp"], | |
| ) | |
| fx_test( | |
| name = "task-exceptions-test", | |
| package = ":task-exceptions-tests", | |
| ) |