blob: 358052a3cfd719b5fcaeaada7c5a8572041d403d [file] [log] [blame]
# Copyright 2025 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/boot_tests/zbi_test.gni")
import("//build/toolchain/zircon/user_basic_redirect.gni")
import("//zircon/kernel/kernel_package.gni")
import("//zircon/kernel/phys/kernel_elf_binary.gni")
kernel_elf_binary("trivial-test-userboot") {
visibility = [ ":*" ]
testonly = true
configs += [ "//zircon/kernel/phys:phys-elf-module.config" ]
has_patches = false
sources = [ "trivial-test-userboot.cc" ]
defines = [ "BOOT_TEST_SUCCESS_STRING=\"$boot_test_success_string\"" ]
deps = [
"//sdk/lib/c/stdlib:hermetic",
"//sdk/lib/c/string:hermetic",
"//src/lib/elfldltl/test:static-pie",
"//src/zircon/lib/zircon",
]
exclude_toolchain_tags = [ "instrumented" ]
# Avoid libc references from assert() in libc++ header code.
defines += [ "NDEBUG=1" ]
# A standalone binary should indicate its stack requirements.
# They should be minimal for this test.
ldflags = [ "-Wl,-z,stack-size=0x1000" ]
}
user_basic_redirect("trivial-test-userboot.basic") {
visibility = [
":*",
"//zircon/kernel/phys/test/*",
]
testonly = true
public_deps = [ ":trivial-test-userboot" ]
}
kernel_package("select-userboot-test") {
visibility = [ ":*" ]
testonly = true
deps = [
":trivial-test-userboot.basic",
"//zircon/kernel:vmzircon(//zircon/kernel:kernel_$current_cpu)",
"//zircon/kernel/lib/userabi/vdso",
"//zircon/kernel/lib/version:version-string.txt",
]
}
zbi_test("select-userboot-boot-test") {
args = [
"kernel.enable-serial-syscalls=true",
"kernel.select.userboot=trivial-test-userboot",
"kernel.select=select-userboot-test",
]
deps = [
":select-userboot-test",
"//zircon/kernel/phys:physboot",
]
}
group("boot_tests") {
testonly = true
deps = [ ":select-userboot-boot-test" ]
}