blob: 44292571a140a57fa6cd040660f3016cea74ac17 [file] [edit]
# 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/image/eng",
]
}
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" ]
deps = [ ":cprng-draw-zbi($default_toolchain)" ]
}
go_test("kernel_cprng_tests") {
embed = [ ":lib" ]
non_go_deps = [
":main_zbi",
"//build/images/fuchsia:default_product_bundle_for_emulator.go",
]
}
}