| # Copyright 2020 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("//boards/default_for_emulator.gni") | |
| import("//build/assembly/test_product_bundle.gni") | |
| import("//build/go/go_library.gni") | |
| import("//build/go/go_test.gni") | |
| import("//build/testing/host_test_data.gni") | |
| group("tests") { | |
| testonly = true | |
| deps = [] | |
| if (host_os == "linux") { | |
| deps += [ | |
| ":shell_default_test($host_toolchain)", | |
| ":shell_disabled_test($host_toolchain)", | |
| ":shell_enabled_test($host_toolchain)", | |
| ] | |
| } | |
| } | |
| if (is_linux) { | |
| _pb_label = ":test_product_bundle($default_toolchain)" | |
| _pb_out_dir = get_label_info(_pb_label, "target_out_dir") | |
| _pb_path = "${_pb_out_dir}/test_product_bundle" | |
| host_test_data("test_product_bundle_data") { | |
| sources = [ _pb_path ] | |
| deps = [ _pb_label ] | |
| } | |
| # These take >5m (the infra timeout) if they're all in one binary, so they | |
| # need to be split into multiple binaries. | |
| template("split_go_test") { | |
| split_name = invoker.target_name | |
| go_library(target_name) { | |
| testonly = true | |
| source_dir = "//src/tests/disable_shell/$split_name" | |
| deps = [ "//tools/emulator/emulatortest" ] | |
| forward_variables_from(invoker, [ "sources" ]) | |
| } | |
| go_test("${split_name}_test") { | |
| embed = [ ":$split_name" ] | |
| args = [ | |
| "--emulator.pb-path", | |
| rebase_path(_pb_path, root_build_dir), | |
| ] | |
| non_go_deps = [ ":test_product_bundle_data" ] | |
| } | |
| } | |
| split_go_test("shell_disabled") { | |
| sources = [ "shell_disabled_test.go" ] | |
| } | |
| split_go_test("shell_enabled") { | |
| sources = [ "shell_enabled_test.go" ] | |
| } | |
| split_go_test("shell_default") { | |
| sources = [ "shell_default_test.go" ] | |
| } | |
| } | |
| if (current_toolchain == default_toolchain) { | |
| test_product_bundle("test_product_bundle") { | |
| board_config = default_board_for_emulator | |
| platform = { | |
| build_type = "eng" | |
| } | |
| } | |
| } |