| # 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/host_test_data.gni") |
| import("//build/testing/zbi_test.gni") |
| import("//build/testing/zbi_test_executable.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" ] |
| } |
| |
| zbi_test("cprng-draw-zbi") { |
| assert(current_cpu != "") |
| 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") { |
| gopackages = [ "go.fuchsia.dev/fuchsia/src/tests/kernel_cprng" ] |
| deps = [ ":lib" ] |
| non_go_deps = [ ":main_zbi" ] |
| } |
| } |