| # Copyright 2020 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("//boards/default_for_emulator.gni") | |
| import("//build/assembly/test_product_bundle.gni") | |
| import("//build/go/go_library.gni") | |
| import("//build/go/go_test.gni") | |
| import("//build/testing/host_test_data.gni") | |
| group("tests") { | |
| testonly = true | |
| deps = [] | |
| # kernel_panic_tests uses //tools/emulator, which only works on | |
| # linux. | |
| if (host_os == "linux") { | |
| deps += [ ":kernel_panic_tests($host_toolchain)" ] | |
| } | |
| } | |
| if (is_linux) { | |
| _pb_label = ":test_product_bundle($default_toolchain)" | |
| _pb_out_dir = get_label_info(_pb_label, "target_out_dir") | |
| _pb_path = "${_pb_out_dir}/test_product_bundle" | |
| host_test_data("test_product_bundle_data") { | |
| sources = [ _pb_path ] | |
| deps = [ _pb_label ] | |
| } | |
| go_library("lib") { | |
| testonly = true | |
| deps = [ "//tools/emulator/emulatortest" ] | |
| sources = [ "kernel_panic_test.go" ] | |
| } | |
| go_test("kernel_panic_tests") { | |
| embed = [ ":lib" ] | |
| args = [ | |
| "--emulator.pb-path", | |
| rebase_path(_pb_path, root_build_dir), | |
| ] | |
| non_go_deps = [ ":test_product_bundle_data" ] | |
| } | |
| } | |
| if (current_toolchain == default_toolchain) { | |
| test_product_bundle("test_product_bundle") { | |
| board_config = default_board_for_emulator | |
| platform = { | |
| build_type = "eng" | |
| } | |
| } | |
| } |