| # Copyright 2021 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/components.gni") |
| import("//build/test.gni") |
| import("//build/zircon/migrated_targets.gni") |
| |
| zx_library("boot-shim") { |
| sdk = "source" |
| sdk_headers = [ |
| "lib/boot-shim/acpi.h", |
| "lib/boot-shim/boot-shim.h", |
| "lib/boot-shim/item-base.h", |
| "lib/boot-shim/pool-mem-config.h", |
| "lib/boot-shim/test-serial-number.h", |
| ] |
| |
| public_deps = [ |
| # <lib/boot-shim/item-base.h> has #include <lib/stdcompat/span.h>. |
| "//sdk/lib/stdcompat", |
| |
| # <lib/boot-shim/item-base.h> has #include <lib/zbitl/image.h>. |
| "//zircon/system/ulib/zbitl", |
| |
| # <lib/boot-shim/item-base.h> #include <lib/fitx/result.h> |
| "//zircon/system/ulib/zxc", |
| ] |
| |
| sources = [ |
| "acpi.cc", |
| "boot-shim.cc", |
| "cmdline.cc", |
| "pool-mem-config.cc", |
| "test-serial-number.cc", |
| ] |
| |
| deps = [ |
| "//zircon/kernel/lib/acpi_lite", |
| "//zircon/kernel/lib/boot-options", |
| "//zircon/kernel/phys/lib/memalloc", |
| "//zircon/system/ulib/pretty", |
| "//zircon/system/ulib/uart", |
| ] |
| } |
| |
| if (!is_kernel) { |
| zx_library("boot-shim-test") { |
| testonly = true |
| |
| sdk = "source" |
| sdk_headers = [ "lib/boot-shim/test-helper.h" ] |
| |
| sources = [ "test-helper.cc" ] |
| deps = [ |
| "//zircon/system/ulib/zbitl", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":boot-shim-tests", |
| ":boot-shim-unittests($host_toolchain)", |
| ] |
| } |
| |
| test("boot-shim-unittests") { |
| sources = [ |
| "acpi-tests.cc", |
| "pool-mem-config-tests.cc", |
| "test-serial-number-tests.cc", |
| ] |
| deps = [ |
| ":boot-shim", |
| ":boot-shim-test", |
| "//zircon/kernel/lib/acpi_lite", |
| "//zircon/kernel/phys/lib/memalloc", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("boot-shim-tests") { |
| deps = [ ":boot-shim-unittests" ] |
| } |