blob: 1e5804fcdbafdf5b9a9cd1f79702c38fa3dbe789 [file] [log] [blame] [edit]
# Copyright 2020 The Fuchsia Authors
#
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT
import("//build/testing/boot_tests/boot_test.gni")
import("//build/testing/environments.gni")
import("//zircon/kernel/phys/phys_executable.gni")
# Defines a boot test comprised of a Linux kernel payload, where early
# set-up is a function of the devicetree alone.
#
# Parameters:
#
# * timeout
# - Optional: Amount in seconds to wait for success string to be printed.
# - Default: boot_test default value (600 = 10m)
#
# Apart from output_dir and output_extension, other parameters are propagated
# to phys_executable(), which see.
template("devicetree_boot_test") {
test_target = "$target_name"
public_visibility = []
if (defined(invoker.visibility)) {
public_visibility = invoker.visibility + [ ":$test_target" ]
} else {
public_visibility = [ "*" ]
}
executable_target = "_devicetree_phys_test.$test_target.executable"
phys_executable(executable_target) {
testonly = true
visibility = [ ":*" ]
output_name = test_target
deps = []
forward_variables_from(invoker,
"*",
[
"initrd",
"output_dir",
"output_extension",
"output_name",
"tags",
"target_name",
"testonly",
"timeout",
"visibility",
])
deps += [
"//zircon/kernel/arch/$current_cpu/phys:linuxboot",
"//zircon/kernel/phys/test:devicetree-test-main",
]
emulator_support_aib = true
}
boot_test(test_target) {
forward_variables_from(invoker, [ "timeout" ])
visibility = public_visibility
environments = [ qemu_env ]
# The only architecture that supports both linux-style devicetree booting
# and crosvm is arm64.
if (current_cpu == "arm64") {
environments += [ crosvm_env ]
}
qemu_kernel = ":$executable_target"
}
}