blob: 55475e855f90dd2eef461567bc729b78f0a67af4 [file]
# 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/packages:fx_package.bzl", "fx_package")
load(
"//build/bazel/rules/packages:fx_packaged_binary.bzl",
"fx_packaged_binary",
)
load("//build/bazel/rules/rust:rustc_binary.bzl", "rustc_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")
load(
"//build/bazel/rules/testing:fx_unittest_component.bzl",
"fx_unittest_component",
)
package(default_applicable_licenses = ["//:license"])
rustc_library(
name = "driver_debug_lib",
srcs = ["src/lib.rs"],
edition = "2024",
visibility = ["//src/devices/bin/driver_debug/tests:__pkg__"],
deps = [
"//sdk/fidl/fuchsia.driver.debug:fuchsia.driver.debug_rust",
"//sdk/rust/zx",
"//src/lib/fuchsia-component",
"//third_party/rust_crates/vendor:anyhow",
],
)
# Needs reviewer attention (bazel2gn skip): Keeping the dual-built GN fuchsia_test_package wired alongside bazel_test_suite fails core.x64-asan testsharder ("some shard names are repeated: affected:AEMU") when use_test_pilot = true sets os = "linux" on the GN test; TODO(https://fxbug.dev/570694755).
# @bazel2gn:skip
rustc_test(
name = "driver_debug_lib_test",
crate = ":driver_debug_lib",
# Unique crate_name to avoid a GN output_name collision with
# //sdk/lib/driver/debug/rust:driver_debug_lib_test.
crate_name = "driver_debug_lib_lib_test",
deps = [
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//third_party/rust_crates/vendor:futures",
],
)
rustc_binary(
name = "debug",
srcs = ["src/main.rs"],
build_flags = ["//build/config/rust:bootfs"],
edition = "2024",
tags = ["manual"],
deps = [
":driver_debug_lib",
"//sdk/rust/zx",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//third_party/rust_crates/vendor:anyhow",
"//third_party/rust_crates/vendor:argh",
"//third_party/rust_crates/vendor:futures",
],
)
# Needs reviewer attention (bazel2gn skip): Keeping the dual-built GN fuchsia_test_package wired alongside bazel_test_suite fails core.x64-asan testsharder ("some shard names are repeated: affected:AEMU") when use_test_pilot = true sets os = "linux" on the GN test; TODO(https://fxbug.dev/570694755).
# @bazel2gn:skip
rustc_test(
name = "debug_test",
build_flags = ["//build/config/rust:bootfs"],
crate = ":debug",
# Unique crate_name to avoid a GN output_name collision with
# //src/connectivity/wlan/drivers/third_party/broadcom/brcmfmac/test:debug_test
# and //src/lib/debug/rust:rust_test.
crate_name = "debug_bin_test",
)
# Needs reviewer attention (bazel2gn skip): Keeping the dual-built GN fuchsia_test_package wired alongside bazel_test_suite fails core.x64-asan testsharder ("some shard names are repeated: affected:AEMU") when use_test_pilot = true sets os = "linux" on the GN test; TODO(https://fxbug.dev/570694755).
# @bazel2gn:skip
fx_unittest_component(
name = "debug_test_component",
binary = ":debug_test",
)
# Needs reviewer attention (bazel2gn skip): Keeping the dual-built GN fuchsia_test_package wired alongside bazel_test_suite fails core.x64-asan testsharder ("some shard names are repeated: affected:AEMU") when use_test_pilot = true sets os = "linux" on the GN test; TODO(https://fxbug.dev/570694755).
# @bazel2gn:skip
fx_unittest_component(
name = "driver_debug_lib_test_component",
binary = ":driver_debug_lib_test",
)
# Needs reviewer attention (bazel2gn skip): Keeping the dual-built GN fuchsia_test_package wired alongside bazel_test_suite fails core.x64-asan testsharder ("some shard names are repeated: affected:AEMU") when use_test_pilot = true sets os = "linux" on the GN test; TODO(https://fxbug.dev/570694755).
# @bazel2gn:skip
fx_package(
name = "driver_debug_unit_tests_package",
package_name = "driver_debug_unit_tests",
test_components = [
":debug_test_component",
":driver_debug_lib_test_component",
],
)
fx_test(
name = "driver_debug_unit_tests",
package = ":driver_debug_unit_tests_package",
)
fx_packaged_binary(
name = "debug_packaged_bin",
binary = ":debug",
binary_name = "debug",
)