blob: 59a6530e1a685f44e991f34c9b041cd6257b8458 [file] [log] [blame]
# 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")
import("//build/testing/host_test_data.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("support") {
testonly = true
source_dir = "//src/tests/reboot/support"
deps = [ "//tools/emulator" ]
sources = [ "reboot.go" ]
}
host_test_data("main_zbi") {
sources = [ "$root_build_dir/fuchsia.zbi" ]
}
# 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 = [ ":support" ]
forward_variables_from(invoker, [ "sources" ])
}
go_test("${split_name}_test") {
gopackages = [ "go.fuchsia.dev/fuchsia/src/tests/reboot/$split_name" ]
deps = [ ":$split_name" ]
non_go_deps = [ ":main_zbi" ]
}
}
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" ]
}
}