| # 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/platforms:constraints.bzl", "HOST_OS_CONSTRAINTS") | |
| load("//build/bazel/rules/host_tests:host_rustc_test.bzl", "host_rustc_test") | |
| load("//build/bazel/rules/idk:idk_ffx_tool.bzl", "idk_ffx_tool") | |
| load("//build/bazel/rules/rust:rustc_library.bzl", "rustc_library") | |
| load("//build/tools/json_merge:json_merge.bzl", "json_merge") | |
| package(default_applicable_licenses = ["//:license"]) | |
| json_merge( | |
| name = "ffx_test_config", | |
| srcs = ["data/config.json"], | |
| minify = True, | |
| visibility = ["//src/developer/ffx:__pkg__"], | |
| ) | |
| rustc_library( | |
| name = "ffx_test_args", | |
| srcs = ["src/args.rs"], | |
| crate_root = "src/args.rs", | |
| edition = "2024", | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| deps = [ | |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_rust", | |
| "//src/lib/diagnostics/data/rust", | |
| "//src/lib/diagnostics/selectors", | |
| "//third_party/rust_crates/vendor:anyhow", | |
| "//third_party/rust_crates/vendor:argh", | |
| ], | |
| ) | |
| rustc_library( | |
| name = "ffx_test", | |
| srcs = [ | |
| "src/connector.rs", | |
| "src/lib.rs", | |
| "src/pilot.rs", | |
| "src/suite_definition.rs", | |
| ], | |
| edition = "2024", | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| deps = [ | |
| ":ffx_test_args", | |
| "//sdk/fidl/fuchsia.developer.remotecontrol:fuchsia.developer.remotecontrol_rust_fdomain", | |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_rust_fdomain", | |
| "//sdk/fidl/fuchsia.diagnostics.types:fuchsia.diagnostics.types_rust_fdomain", | |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust_fdomain", | |
| "//sdk/fidl/fuchsia.test.manager:fuchsia.test.manager_rust_fdomain", | |
| "//src/developer/ffx/config:lib", | |
| "//src/developer/ffx/lib/errors:lib", | |
| "//src/developer/ffx/lib/fho:lib", | |
| "//src/developer/ffx/lib/target/holders:lib", | |
| "//src/developer/ffx/lib/testing:lib", | |
| "//src/developer/ffx/lib/writer:lib", | |
| "//src/developer/ffx/plugins/component/common:ffx_component", | |
| "//src/lib/diagnostics/data/rust", | |
| "//src/lib/fdomain/client", | |
| "//src/lib/fidl/rust/fidl", | |
| "//src/lib/testing/test_list", | |
| "//src/sys/run_test_suite:lib_fdomain", | |
| "//third_party/rust_crates/vendor:anyhow", | |
| "//third_party/rust_crates/vendor:chrono", | |
| "//third_party/rust_crates/vendor:futures", | |
| "//third_party/rust_crates/vendor:itertools", | |
| "//third_party/rust_crates/vendor:log", | |
| "//third_party/rust_crates/vendor:schemars", | |
| "//third_party/rust_crates/vendor:serde", | |
| "//third_party/rust_crates/vendor:serde_json", | |
| "//third_party/rust_crates/vendor:signal-hook", | |
| "//tools/test_pilot/test_pilot_lib", | |
| ], | |
| ) | |
| # LINT.IfChange | |
| idk_ffx_tool( | |
| name = "ffx_test_tool", | |
| srcs = ["src/main.rs"], | |
| category = "partner", | |
| edition = "2024", | |
| idk_name = "ffx-test", | |
| deps = [ | |
| ":ffx_test", | |
| "//src/developer/ffx/lib/fho:lib", | |
| "//src/lib/fuchsia-async", | |
| ], | |
| ) | |
| # LINT.ThenChange(BUILD.gn) | |
| host_rustc_test( | |
| name = "ffx_test_args_test", | |
| crate = ":ffx_test_args", | |
| visibility = ["//src/developer/ffx:__pkg__"], | |
| deps = [ | |
| "//third_party/rust_crates/vendor:tempfile", | |
| ], | |
| ) | |
| host_rustc_test( | |
| name = "ffx_test_test", | |
| crate = ":ffx_test", | |
| link_deps = [ | |
| "//third_party/zstd", | |
| ], | |
| visibility = ["//src/developer/ffx:__pkg__"], | |
| deps = [ | |
| "//src/lib/fdomain/local", | |
| "//src/lib/fuchsia", | |
| "//src/lib/fuchsia-async", | |
| "//third_party/rust_crates/vendor:tempfile", | |
| "//third_party/rust_crates/vendor:walkdir", | |
| "//third_party/rust_crates/vendor:zstd", | |
| ], | |
| ) |