| # 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/tools/json_merge:json_merge.bzl", "json_merge") | |
| load("//src/developer/ffx/build:gn_ffx_test_data.bzl", "gn_ffx_test_data") | |
| package(default_applicable_licenses = ["//:license"]) | |
| # Keep in sync with `json_merge("ffx-defaults.json")` in `BUILD.gn` and plugin | |
| # lists in `config.gni`. | |
| # TODO(https://fxbug.dev/512659653): As remaining `ffx_plugin` targets migrate | |
| # to Bazel, replace | |
| # `//src/developer/ffx/plugins/{emulator,log}:data/config.json` with | |
| # `:<plugin>_config` subtargets. | |
| json_merge( | |
| name = "ffx-defaults.json", | |
| srcs = [ | |
| "data/config.json", | |
| "//src/developer/ffx/frontends/ffx:ffx_lib_config", | |
| "//src/developer/ffx/lib/pbms:data/config.json", | |
| "//src/developer/ffx/plugins/emulator:data/config.json", | |
| "//src/developer/ffx/plugins/log:data/config.json", | |
| "//src/developer/ffx/plugins/product:data/config.json", | |
| "//src/developer/ffx/plugins/repository:ffx_repository_config", | |
| "//src/developer/ffx/plugins/test:ffx_test_config", | |
| "//src/developer/ffx/plugins/trace:ffx_trace_config", | |
| ], | |
| deep_merge = True, | |
| visibility = ["//src/developer/ffx/config/macro/proc_macro:__pkg__"], | |
| ) | |
| # Exposes the full GN-built ffx binary (`host-tools/ffx`) to Bazel host tests | |
| # until //src/developer/ffx/frontends/ffx includes all built-in plugins. | |
| # Needed for SDK inclusion | |
| # | |
| # TODO(https://fxbug.dev/330934833): Remove when IDK allows for `testonly` targets in dep | |
| # tree or when we can separate the concept of data_dep from host_test_data. | |
| # @bazel2gn:skip | |
| gn_ffx_test_data( | |
| name = "test_data", | |
| testonly = False, | |
| expected_files = ["ffx"], | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| visibility = ["//src/developer/ffx/build/tests:__pkg__"], | |
| ) | |
| test_suite( | |
| name = "tests", | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| tests = [ | |
| "//src/developer/fastboot:lib_test", | |
| "//src/developer/ffx/build/tests:gn_ffx_test_data_host_test", | |
| "//src/developer/ffx/build/tests:gn_ffx_test_data_runfiles_test", | |
| "//src/developer/ffx/build/tests:gn_ffx_test_data_test", | |
| "//src/developer/ffx/frontends/ffx:host_tests", | |
| "//src/developer/ffx/lib/agent:tests", | |
| "//src/developer/ffx/lib/arg_parsing:lib_test", | |
| "//src/developer/ffx/lib/auth:auth_test", | |
| "//src/developer/ffx/lib/buildid:lib_test", | |
| "//src/developer/ffx/lib/compat_info:lib_test", | |
| "//src/developer/ffx/lib/diagnostics/analytics:lib_test", | |
| "//src/developer/ffx/lib/doctor_utils:lib_test", | |
| "//src/developer/ffx/lib/errors:lib_test", | |
| "//src/developer/ffx/lib/fastboot/flash_manifest:lib_test", | |
| "//src/developer/ffx/lib/fastboot/interface:lib_test", | |
| "//src/developer/ffx/lib/futures:lib_test", | |
| "//src/developer/ffx/lib/isolate:lib_test", | |
| "//src/developer/ffx/lib/logging:lib_test", | |
| "//src/developer/ffx/lib/manual_targets:lib_test", | |
| "//src/developer/ffx/lib/mdns_discovery:lib_test", | |
| "//src/developer/ffx/lib/metrics:lib_test", | |
| "//src/developer/ffx/lib/netext:lib_test", | |
| "//src/developer/ffx/lib/pbms:pbms_lib_test", | |
| "//src/developer/ffx/lib/pkg:pkg_test", | |
| "//src/developer/ffx/lib/port_picker:lib_test", | |
| "//src/developer/ffx/lib/process:lib_test", | |
| "//src/developer/ffx/lib/safe_string:lib_test", | |
| "//src/developer/ffx/lib/ssh:lib_test", | |
| "//src/developer/ffx/lib/target:lib_test", | |
| "//src/developer/ffx/lib/target/behavior:lib_test", | |
| "//src/developer/ffx/lib/target/connector:tests", | |
| "//src/developer/ffx/lib/target/holders:lib_test", | |
| "//src/developer/ffx/lib/target_errors:lib_test", | |
| "//src/developer/ffx/lib/termio:termio_test", | |
| "//src/developer/ffx/lib/testing:lib_test", | |
| "//src/developer/ffx/lib/trace:lib_test", | |
| "//src/developer/ffx/lib/traceable_error:lib_test", | |
| "//src/developer/ffx/lib/traceable_error/derive/tests", | |
| "//src/developer/ffx/lib/uart_driver_api:lib_test", | |
| "//src/developer/ffx/lib/usb_fastboot_discovery:lib_test", | |
| "//src/developer/ffx/lib/version:lib_test", | |
| "//src/developer/ffx/plugins/assembly:ffx_assembly_args_test", | |
| "//src/developer/ffx/plugins/assembly:ffx_assembly_test", | |
| "//src/developer/ffx/plugins/audio/common:ffx_audio_common_test", | |
| "//src/developer/ffx/plugins/audio/device:host_tests", | |
| "//src/developer/ffx/plugins/audio/gen:ffx_audio_gen_args_test", | |
| "//src/developer/ffx/plugins/audio/gen:ffx_audio_gen_test", | |
| "//src/developer/ffx/plugins/audio/list-devices:host_tests", | |
| "//src/developer/ffx/plugins/audio/play:host_tests", | |
| "//src/developer/ffx/plugins/audio/record:host_tests", | |
| "//src/developer/ffx/plugins/component/common:ffx_component_test", | |
| "//src/developer/ffx/plugins/component/create:host_tests", | |
| "//src/developer/ffx/plugins/component/debug:host_tests", | |
| "//src/developer/ffx/plugins/component/destroy:host_tests", | |
| "//src/developer/ffx/plugins/component/graph:host_tests", | |
| "//src/developer/ffx/plugins/component/list:host_tests", | |
| "//src/developer/ffx/plugins/component/reload:host_tests", | |
| "//src/developer/ffx/plugins/component/stop:host_tests", | |
| "//src/developer/ffx/plugins/component/storage:host_tests", | |
| "//src/developer/ffx/plugins/config:ffx_config_plugin_args_test", | |
| "//src/developer/ffx/plugins/config:ffx_config_plugin_test", | |
| "//src/developer/ffx/plugins/coverage:ffx_coverage_test", | |
| "//src/developer/ffx/plugins/debug/connect:tests", | |
| "//src/developer/ffx/plugins/debug/limbo:ffx_debug_limbo_test", | |
| "//src/developer/ffx/plugins/debug/symbol-index:ffx_debug_symbol_index_test", | |
| "//src/developer/ffx/plugins/doctor:host_tests", | |
| "//src/developer/ffx/plugins/emulator/commands/list:ffx_emulator_list_test", | |
| "//src/developer/ffx/plugins/emulator/common:ffx_emulator_common_test", | |
| "//src/developer/ffx/plugins/emulator/configuration:ffx_emulator_config_test", | |
| "//src/developer/ffx/plugins/forward:ffx_forward_args_test", | |
| "//src/developer/ffx/plugins/forward:ffx_forward_test", | |
| "//src/developer/ffx/plugins/fuzz:ffx_fuzz_args_test", | |
| "//src/developer/ffx/plugins/fuzz:ffx_fuzz_test", | |
| "//src/developer/ffx/plugins/package/archive:lib_test", | |
| "//src/developer/ffx/plugins/package/archive/cat:ffx_package_archive_cat_test", | |
| "//src/developer/ffx/plugins/package/archive/list:ffx_package_archive_list_test", | |
| "//src/developer/ffx/plugins/package/blob/compress:ffx_package_blob_compress_test", | |
| "//src/developer/ffx/plugins/package/blob/decompress:ffx_package_blob_decompress_test", | |
| "//src/developer/ffx/plugins/package/blob/hash:ffx_package_blob_hash_test", | |
| "//src/developer/ffx/plugins/package/far/cat:ffx_package_far_cat_test", | |
| "//src/developer/ffx/plugins/package/far/extract:ffx_package_far_extract_test", | |
| "//src/developer/ffx/plugins/package/far/list:ffx_package_far_list_test", | |
| "//src/developer/ffx/plugins/package/file-hash:ffx_package_file_hash_test", | |
| "//src/developer/ffx/plugins/package/ota-manifest/generate:ffx_package_ota_manifest_generate_test", | |
| "//src/developer/ffx/plugins/package/ota-manifest/show:ffx_package_ota_manifest_show_test", | |
| "//src/developer/ffx/plugins/platform/preflight:ffx_preflight_test", | |
| "//src/developer/ffx/plugins/product/common:lib_test", | |
| "//src/developer/ffx/plugins/product/create_old:ffx_product_create_old_lib_test", | |
| "//src/developer/ffx/plugins/product/download:lib_test", | |
| "//src/developer/ffx/plugins/product/extract_blobs:lib_test", | |
| "//src/developer/ffx/plugins/product/get_artifacts:lib_test", | |
| "//src/developer/ffx/plugins/product/get_image_path:lib_test", | |
| "//src/developer/ffx/plugins/product/get_repository:lib_test", | |
| "//src/developer/ffx/plugins/product/get_version:lib_test", | |
| "//src/developer/ffx/plugins/product/list:lib_test", | |
| "//src/developer/ffx/plugins/product/lookup:lib_test", | |
| "//src/developer/ffx/plugins/product/show:lib_test", | |
| "//src/developer/ffx/plugins/product_bundle/bisect:ffx_product_bundle_bisect_test", | |
| "//src/developer/ffx/plugins/product_bundle/create:ffx_product_bundle_create_test", | |
| "//src/developer/ffx/plugins/profile/cpu/load:ffx_cpu_load_test", | |
| "//src/developer/ffx/plugins/profile/gpu/usage:ffx_gpu_usage_args_test", | |
| "//src/developer/ffx/plugins/profile/gpu/usage:ffx_gpu_usage_test", | |
| "//src/developer/ffx/plugins/profile/memory:ffx_profile_memory_test", | |
| "//src/developer/ffx/plugins/profile/memory/components:ffx_profile_memory_components_test", | |
| "//src/developer/ffx/plugins/profile/memory/signal:ffx_profile_memory_signal_args_test", | |
| "//src/developer/ffx/plugins/profile/network/activity:ffx_network_activity_args_test", | |
| "//src/developer/ffx/plugins/profile/network/activity:ffx_network_activity_test", | |
| "//src/developer/ffx/plugins/profile/power/logger:ffx_power_logger_test", | |
| "//src/developer/ffx/plugins/profile/temperature/logger:ffx_temperature_logger_args_test", | |
| "//src/developer/ffx/plugins/profile/temperature/logger:ffx_temperature_logger_test", | |
| "//src/developer/ffx/plugins/repository/create:ffx_repository_create_test", | |
| "//src/developer/ffx/plugins/repository/default:ffx_repository_default_test", | |
| "//src/developer/ffx/plugins/repository/packages:ffx_repository_packages_test", | |
| "//src/developer/ffx/plugins/repository/publish:ffx_repository_publish_test", | |
| "//src/developer/ffx/plugins/repository/serve-archive:ffx_repository_serve_archive_test", | |
| "//src/developer/ffx/plugins/repository/server/list:ffx_repository_server_list_test", | |
| "//src/developer/ffx/plugins/repository/server/start:ffx_repository_server_start_test", | |
| "//src/developer/ffx/plugins/repository/server/stop:ffx_repository_server_stop_test", | |
| "//src/developer/ffx/plugins/sdk:ffx_sdk_test", | |
| "//src/developer/ffx/plugins/self-test:ffx_selftest_test", | |
| "//src/developer/ffx/plugins/session/add:ffx_session_add_test", | |
| "//src/developer/ffx/plugins/session/drop-power-lease:ffx_session_drop_power_lease_test", | |
| "//src/developer/ffx/plugins/session/launch:ffx_session_launch_test", | |
| "//src/developer/ffx/plugins/session/remove:ffx_session_remove_test", | |
| "//src/developer/ffx/plugins/session/restart:ffx_session_restart_test", | |
| "//src/developer/ffx/plugins/session/show:ffx_session_show_test", | |
| "//src/developer/ffx/plugins/session/start:ffx_session_start_test", | |
| "//src/developer/ffx/plugins/session/stop:ffx_session_stop_test", | |
| "//src/developer/ffx/plugins/setui/accessibility:ffx_setui_accessibility_args_test", | |
| "//src/developer/ffx/plugins/setui/accessibility:ffx_setui_accessibility_test", | |
| "//src/developer/ffx/plugins/setui/audio:ffx_setui_audio_args_test", | |
| "//src/developer/ffx/plugins/setui/audio:ffx_setui_audio_test", | |
| "//src/developer/ffx/plugins/setui/display:ffx_setui_display_args_test", | |
| "//src/developer/ffx/plugins/setui/display:ffx_setui_display_test", | |
| "//src/developer/ffx/plugins/setui/do_not_disturb:ffx_setui_do_not_disturb_args_test", | |
| "//src/developer/ffx/plugins/setui/do_not_disturb:ffx_setui_do_not_disturb_test", | |
| "//src/developer/ffx/plugins/setui/factory_reset:ffx_setui_factory_reset_args_test", | |
| "//src/developer/ffx/plugins/setui/factory_reset:ffx_setui_factory_reset_test", | |
| "//src/developer/ffx/plugins/setui/input:ffx_setui_input_args_test", | |
| "//src/developer/ffx/plugins/setui/input:ffx_setui_input_test", | |
| "//src/developer/ffx/plugins/setui/intl:ffx_setui_intl_args_test", | |
| "//src/developer/ffx/plugins/setui/intl:ffx_setui_intl_test", | |
| "//src/developer/ffx/plugins/setui/keyboard:ffx_setui_keyboard_args_test", | |
| "//src/developer/ffx/plugins/setui/keyboard:ffx_setui_keyboard_test", | |
| "//src/developer/ffx/plugins/setui/light:ffx_setui_light_args_test", | |
| "//src/developer/ffx/plugins/setui/light:ffx_setui_light_test", | |
| "//src/developer/ffx/plugins/setui/night_mode:host_tests", | |
| "//src/developer/ffx/plugins/setui/privacy:host_tests", | |
| "//src/developer/ffx/plugins/setui/setup:host_tests", | |
| "//src/developer/ffx/plugins/target/add:ffx_target_add_test", | |
| "//src/developer/ffx/plugins/target/bootloader:host_tests", | |
| "//src/developer/ffx/plugins/target/default:ffx_target_default_test", | |
| "//src/developer/ffx/plugins/target/discover:ffx_target_discover_test", | |
| "//src/developer/ffx/plugins/target/echo:ffx_target_echo_args_test", | |
| "//src/developer/ffx/plugins/target/echo:ffx_target_echo_test", | |
| "//src/developer/ffx/plugins/target/fastboot:host_tests", | |
| "//src/developer/ffx/plugins/target/flash:host_tests", | |
| "//src/developer/ffx/plugins/target/get-time:ffx_target_get_time_test", | |
| "//src/developer/ffx/plugins/target/list:host_tests", | |
| "//src/developer/ffx/plugins/target/list/target_formatter:host_tests", | |
| "//src/developer/ffx/plugins/target/log-message:ffx_target_log_message_test", | |
| "//src/developer/ffx/plugins/target/off:ffx_off_test", | |
| "//src/developer/ffx/plugins/target/package/explore:host_tests", | |
| "//src/developer/ffx/plugins/target/package/resolve:ffx_target_package_resolve_test", | |
| "//src/developer/ffx/plugins/target/reboot:host_tests", | |
| "//src/developer/ffx/plugins/target/remove:ffx_target_remove_test", | |
| "//src/developer/ffx/plugins/target/repository/deregister:ffx_target_repository_deregister_test", | |
| "//src/developer/ffx/plugins/target/repository/list:ffx_target_repository_list_test", | |
| "//src/developer/ffx/plugins/target/repository/register:ffx_target_repository_register_test", | |
| "//src/developer/ffx/plugins/target/repository/rule/replace:ffx_target_repository_rule_replace_test", | |
| "//src/developer/ffx/plugins/target/screenshot:ffx_target_screenshot_test", | |
| "//src/developer/ffx/plugins/target/show:ffx_target_show_test", | |
| "//src/developer/ffx/plugins/target/snapshot:ffx_snapshot_test", | |
| "//src/developer/ffx/plugins/target/ssh:ffx_target_ssh_args_test", | |
| "//src/developer/ffx/plugins/target/ssh:ffx_target_ssh_test", | |
| "//src/developer/ffx/plugins/target/update:host_tests", | |
| "//src/developer/ffx/plugins/target/wipe:ffx_wipe_test", | |
| "//src/developer/ffx/plugins/test:ffx_test_args_test", | |
| "//src/developer/ffx/plugins/test:ffx_test_test", | |
| "//src/developer/ffx/plugins/trace:host_tests", | |
| "//src/developer/ffx/plugins/version:ffx_version_test", | |
| "//src/developer/ffx/plugins/wlan/client:ffx_wlan_client_test", | |
| "//src/developer/ffx/plugins/wlan/common:ffx-wlan-common_host_test", | |
| "//src/developer/ffx/tools/bluetooth/common:ffx_bluetooth_common_test", | |
| "//src/developer/ffx/tools/bluetooth/src/controller:ffx_bluetooth_controller_test", | |
| "//src/developer/ffx/tools/bluetooth/src/pairable:ffx_bluetooth_pairable_test", | |
| "//src/developer/ffx/tools/bluetooth/src/pandora:ffx_bluetooth_pandora_test", | |
| "//src/developer/ffx/tools/bluetooth/src/peer:ffx_bluetooth_peer_test", | |
| "//src/developer/ffx/tools/echo:host_tests", | |
| "//src/developer/ffx/tools/efi:ffx-efi_test", | |
| "//src/developer/ffx/tools/monitor:host_tests", | |
| "//src/developer/ffx/tools/speedtest/common:speedtest_fdomain_test", | |
| "//src/developer/ffx/tools/storage:lib_test", | |
| "//src/developer/ffx/tools/triage:ffx_triage_lib_test", | |
| "//src/developer/ffx/tools/uart:host_tests", | |
| "//src/developer/ffx/tools/uart_driver:host_tests", | |
| "//src/developer/ffx/tools/uart_driver/impl:host_tests", | |
| "//src/developer/ffx/tools/usb:lib_test", | |
| "//src/developer/ffx/tools/wm/cycle:ffx_wm_cycle_test", | |
| "//src/developer/ffx/tools/wm/focus:ffx_wm_focus_test", | |
| "//src/developer/ffx/tools/wm/list:ffx_wm_list_test", | |
| "//src/developer/ffx/tools/wm/set-order:ffx_wm_setorder_test", | |
| ], | |
| ) | |
| test_suite( | |
| name = "target_tests", | |
| target_compatible_with = ["@platforms//os:fuchsia"], | |
| tests = [ | |
| "//src/developer/ffx/plugins/wlan/common:ffx-wlan-common-tests", | |
| "//src/developer/ffx/tools/speedtest/common:speedtest-target-tests", | |
| ], | |
| ) |