| # 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/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"]) | |
| test_suite( | |
| name = "tests", | |
| tests = [":trf_codegen_runtime_tests"], | |
| visibility = ["//src/testing:__pkg__"], | |
| ) | |
| rustc_library( | |
| name = "trf_codegen_runtime", | |
| testonly = True, | |
| srcs = ["src/lib.rs"], | |
| edition = "2024", | |
| # Referenced by the trf_test GN template across the repository. | |
| visibility = ["//:__subpackages__"], | |
| deps = [ | |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", | |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust", | |
| "//sdk/fidl/fuchsia.testing.harness:fuchsia.testing.harness_rust", | |
| "//src/lib/fidl/rust/fidl", | |
| "//src/lib/fuchsia-component", | |
| "//src/lib/fuchsia-fs", | |
| "//src/testing/trf_codegen/fidl:fuchsia.trf.factory_rust", | |
| "//third_party/rust_crates/vendor:anyhow", | |
| "//third_party/rust_crates/vendor:futures", | |
| ], | |
| ) | |
| rustc_test( | |
| name = "trf_codegen_runtime_test", | |
| crate = ":trf_codegen_runtime", | |
| target_compatible_with = ["@platforms//os:fuchsia"], | |
| deps = [ | |
| "//src/lib/fuchsia", | |
| "//src/lib/fuchsia-async", | |
| ], | |
| ) | |
| fx_unittest_component( | |
| name = "trf_codegen_runtime_tests_component", | |
| binary = ":trf_codegen_runtime_test", | |
| component_name = "trf_codegen_runtime_tests", | |
| ) | |
| fx_package( | |
| name = "trf_codegen_runtime_tests_package", | |
| package_name = "trf_codegen_runtime_tests", | |
| testonly = True, | |
| components = [ | |
| "//src/lib/fuchsia-component-test/realm_builder_server:realm_builder_server_component", | |
| ], | |
| test_components = [":trf_codegen_runtime_tests_component"], | |
| ) | |
| fx_test( | |
| name = "trf_codegen_runtime_tests", | |
| package = ":trf_codegen_runtime_tests_package", | |
| ) |