blob: 93a26bb0803f9ac0f969bc0b1a21eab506b3a315 [file] [log] [blame]
# Copyright 2021 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/boot_tests/zbi_test.gni")
import("//build/testing/boot_tests/zbi_test_executable.gni")
import("//build/testing/host_test_data.gni")
group("tests") {
testonly = true
deps = []
# cprng_test uses //tools/emulator, which only works on linux.
if (host_os == "linux") {
deps += [ ":kernel_cprng_tests($host_toolchain)" ]
}
}
zbi_test_executable("cprng-draw") {
sources = [ "cprng-draw.cc" ]
deps = [
"//src/zircon/lib/zircon",
"//src/zircon/testing/standalone-test",
]
}
zbi_test("cprng-draw-zbi") {
assert(current_cpu != "")
# TODO(https://fxbug.dev/42066527): This ZBI is not actually a ZBI test, but relies
# on the specification just for the `images` metadata implicitly set by
# `zbi_test()` and not `zbi()`. Investigate whether we can have `zbi()`
# targets set this metadata and update this target accordingly - and
# disable the ZBI from being booted as a ZBI test for now.
disabled = true
deps = [
":cprng-draw",
"//zircon/kernel",
]
}
if (is_linux) {
go_library("lib") {
testonly = true
deps = [ "//tools/emulator/emulatortest" ]
sources = [ "kernel_cprng_test.go" ]
}
host_test_data("main_zbi") {
path =
get_label_info(":cprng-draw-zbi($default_toolchain)", "target_out_dir")
sources = [
"$path/cprng-draw-zbi.zbi",
"$root_build_dir/fuchsia.zbi",
]
deps = [ ":cprng-draw-zbi($default_toolchain)" ]
}
go_test("kernel_cprng_tests") {
library = ":lib"
non_go_deps = [ ":main_zbi" ]
}
}