| # Copyright 2021 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/copy_tree.gni") |
| import("//build/go/go_library.gni") |
| import("//build/go/go_test.gni") |
| import("//build/testing/host_test_data.gni") |
| |
| go_library("lib") { |
| sources = [ "fvdl_intree_test.go" ] |
| deps = [ "//tools/fvdl/e2e/e2etest" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| # TODO(fxbug.dev/78190): this flaky test is super flaky on coverage. |
| # Please fix the flakiness issue and then remove the condition below. |
| if (!is_coverage) { |
| deps = [ ":fvdl_intree_test($host_toolchain)" ] |
| } |
| } |
| |
| if (is_linux) { |
| _device_launcher_in = "//prebuilt/vdl" |
| _device_launcher_out = "${target_gen_dir}/fvdl_test_runtime_deps/vdl" |
| |
| _aemu_in = "//prebuilt/third_party/aemu/${host_platform}" |
| _aemu_out = "${target_gen_dir}/fvdl_test_runtime_deps/aemu" |
| |
| _grpcwebproxy_in = "//prebuilt/third_party/grpcwebproxy/${host_platform}" |
| _grpcwebproxy_out = "${target_gen_dir}/fvdl_test_runtime_deps/grpcwebproxy" |
| |
| _build_out = "${target_gen_dir}/fvdl_test_runtime_deps/images" |
| _tools_out = "${target_gen_dir}/fvdl_test_runtime_deps/host_tools" |
| |
| copy_tree("copy_aemu_tree") { |
| src_dir = _aemu_in |
| dest_dir = _aemu_out |
| } |
| |
| host_test_data("copy_aemu") { |
| sources = [ _aemu_out ] |
| deps = [ ":copy_aemu_tree" ] |
| } |
| |
| copy_tree("copy_grpcwebproxy_tree") { |
| src_dir = _grpcwebproxy_in |
| dest_dir = _grpcwebproxy_out |
| } |
| |
| host_test_data("copy_grpcwebproxy") { |
| sources = [ _grpcwebproxy_out ] |
| deps = [ ":copy_grpcwebproxy_tree" ] |
| } |
| |
| copy_tree("copy_device_launcher_tree") { |
| src_dir = _device_launcher_in |
| dest_dir = _device_launcher_out |
| } |
| |
| host_test_data("copy_device_launcher") { |
| sources = [ _device_launcher_out ] |
| deps = [ ":copy_device_launcher_tree" ] |
| } |
| |
| host_test_data("copy_host_tools") { |
| sources = [ |
| "${host_tools_dir}/device-finder", |
| "${host_tools_dir}/far", |
| "${host_tools_dir}/fvdl", |
| "${host_tools_dir}/pm", |
| get_label_info("//src/storage/bin/fvm", "root_out_dir") + "/fvm", |
| get_label_info("//zircon/tools/zbi", "root_out_dir") + "/zbi", |
| ] |
| deps = [ |
| "//src/storage/bin/fvm($host_toolchain)", |
| "//src/sys/pkg/bin/far:host($host_toolchain)", |
| "//src/sys/pkg/bin/pm:host($host_toolchain)", |
| "//tools/fvdl:host($host_toolchain)", |
| "//tools/net/device-finder:host($host_toolchain)", |
| "//zircon/tools/zbi($host_toolchain)", |
| ] |
| outputs = [ "${_tools_out}/{{source_file_part}}" ] |
| } |
| |
| host_test_data("copy_images") { |
| sources = [ |
| get_label_info("//build/images:fvm.blk($target_toolchain)", |
| "target_out_dir") + "/fvm.blk", |
| get_label_info("//build/images:fuchsia($target_toolchain)", |
| "root_out_dir") + "/fuchsia.zbi", |
| "${root_build_dir}/multiboot.bin", |
| "${root_build_dir}/packages.tar.gz", |
| ] |
| outputs = [ "${_build_out}/{{source_file_part}}" ] |
| deps = [ |
| "//build/gn:package_archive($target_toolchain)", |
| "//build/images:fuchsia($target_toolchain)", |
| "//build/images:fvm.blk($target_toolchain)", |
| "//zircon/kernel/target/pc/multiboot:multiboot($target_toolchain)", |
| ] |
| } |
| |
| go_test("fvdl_intree_test") { |
| output_name = "fvdl_intree_test" |
| gopackages = [ "go.fuchsia.dev/fuchsia/tools/fvdl/e2e" ] |
| deps = [ ":lib" ] |
| non_go_deps = [ |
| ":copy_aemu", |
| ":copy_device_launcher", |
| ":copy_grpcwebproxy", |
| ":copy_host_tools", |
| ":copy_images", |
| ] |
| } |
| } |