| # Copyright 2019 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") |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [] |
| |
| if (host_os == "linux") { |
| deps += [ |
| ":dm_reboot_bootloader_test($host_toolchain)", |
| ":dm_reboot_recovery_test($host_toolchain)", |
| ":dm_reboot_test($host_toolchain)", |
| ":kill_critical_process_test($host_toolchain)", |
| ] |
| } |
| } |
| |
| if (is_linux) { |
| go_library("reboottest") { |
| testonly = true |
| |
| source_dir = "//src/tests/reboot/reboottest" |
| |
| deps = [ "//tools/emulator/emulatortest" ] |
| |
| sources = [ "reboottest.go" ] |
| } |
| |
| # The CQ/CI test infrastructure has a per-binary timeout. When the target |
| # (Fuchsia) is built with asan and ubsan instrumentation, it can take a long |
| # time to boot (60s or more). To avoid exceeding the timeout, each test case |
| # gets its own binary and therefore own timeout. |
| template("split_go_test") { |
| split_name = invoker.target_name |
| go_library(target_name) { |
| testonly = true |
| source_dir = "//src/tests/reboot/$split_name" |
| deps = [ ":reboottest" ] |
| forward_variables_from(invoker, [ "sources" ]) |
| } |
| |
| go_test("${split_name}_test") { |
| library = ":$split_name" |
| non_go_deps = [ "//build/images/fuchsia:fuchsia_zbi_for_host_tests" ] |
| } |
| } |
| |
| split_go_test("dm_reboot") { |
| sources = [ "dm_reboot_test.go" ] |
| } |
| split_go_test("dm_reboot_recovery") { |
| sources = [ "dm_reboot_recovery_test.go" ] |
| } |
| split_go_test("dm_reboot_bootloader") { |
| sources = [ "dm_reboot_bootloader_test.go" ] |
| } |
| split_go_test("kill_critical_process") { |
| sources = [ "kill_critical_process_test.go" ] |
| } |
| } |