| # Copyright 2022 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. | |
| import("//build/host.gni") | |
| import("//build/images/paths.gni") | |
| import("//build/rust/rustc_library.gni") | |
| import("//src/developer/ffx/build/ffx_tool.gni") | |
| import("//src/developer/ffx/config.gni") | |
| import("//src/developer/ffx/lib/version/build/ffx_apply_version.gni") | |
| if (is_host && target_cpu == "x64") { | |
| ffx = "${ffx_test_host_tools_out_dir}/ffx" | |
| emu_dir = "//prebuilt/third_party/qemu/${host_platform}" | |
| product_bundle = files.product_bundle_dir | |
| bootloader = "${product_bundle}/partitions/bootloader_partitions/0/image/fuchsia.esp.blk" | |
| run_zircon = "//zircon/scripts/run-zircon" | |
| rustc_library("ffx_testing") { | |
| edition = "2024" | |
| with_unit_tests = false | |
| testonly = true | |
| deps = [ | |
| "//src/developer/ffx/config:lib", | |
| "//src/developer/ffx/lib/isolate:lib", | |
| "//src/lib/fuchsia-async", | |
| "//third_party/rust_crates:anyhow", | |
| "//third_party/rust_crates:futures", | |
| "//third_party/rust_crates:tempfile", | |
| "//third_party/rust_crates:tokio", | |
| "//tools/make-fuchsia-vol:lib", | |
| ] | |
| non_rust_deps = [ | |
| ":prebuilt_qemu", | |
| ":test_data", | |
| "//src/developer/ffx:test_data", | |
| ] | |
| sources = [ | |
| "src/emu.rs", | |
| "src/lib.rs", | |
| ] | |
| rustenv = [ | |
| "FFX=" + rebase_path(ffx, root_build_dir), | |
| "QEMU_PATH=" + rebase_path(emu_dir, root_build_dir), | |
| "PRODUCT_BUNDLE=" + rebase_path(product_bundle, root_build_dir), | |
| "BOOTLOADER=" + rebase_path(bootloader, root_build_dir), | |
| "RUN_ZIRCON=" + rebase_path(run_zircon, root_build_dir), | |
| ] | |
| } | |
| host_test_data("prebuilt_qemu") { | |
| sources = [ emu_dir ] | |
| } | |
| host_test_data("test_data") { | |
| deps = [ "//src/firmware/gigaboot/cpp:fuchsia" ] | |
| sources = [ | |
| "//prebuilt/third_party/edk2/qemu-x64/OVMF_CODE.fd", | |
| "//prebuilt/third_party/edk2/qemu-x64/OVMF_VARS.fd", | |
| product_bundle, | |
| run_zircon, | |
| ] | |
| } | |
| } |