| # 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("//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) { | 
 |   go_library("disable_shell_support_lib") { | 
 |     testonly = true | 
 |  | 
 |     source_dir = "//src/tests/disable_shell/support" | 
 |  | 
 |     deps = [ "//src/testing/qemu" ] | 
 |   } | 
 |  | 
 |   host_test_data("main_zbi") { | 
 |     sources = [ "$root_build_dir/fuchsia.zbi" ] | 
 |   } | 
 |  | 
 |   # 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 = [ | 
 |         ":disable_shell_support_lib", | 
 |         "//src/testing/qemu", | 
 |       ] | 
 |     } | 
 |  | 
 |     go_test("${split_name}_test") { | 
 |       gopackages = | 
 |           [ "go.fuchsia.dev/fuchsia/src/tests/disable_shell/$split_name" ] | 
 |       deps = [ ":$split_name" ] | 
 |       non_go_deps = [ ":main_zbi" ] | 
 |     } | 
 |   } | 
 |  | 
 |   split_go_test("shell_disabled") { | 
 |   } | 
 |   split_go_test("shell_enabled") { | 
 |   } | 
 |   split_go_test("shell_default") { | 
 |   } | 
 | } |