| # Copyright 2019 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/test.gni") |
| import("//build/zircon/migrated_targets.gni") |
| |
| # TODO(fxbug.dev/54322): Keep in sync with BUILD.gn until the bootloader |
| # is fully migrated to the Fuchsia build. |
| |
| config("config") { |
| # Fastboot needs to provide the board name so `ffx flash` can verify it. |
| cflags = [ "-DBOARD_NAME=\"${board_name}\"" ] |
| } |
| |
| source_set("src") { |
| sources = [ |
| "abr.c", |
| "acpi.c", |
| "avb.c", |
| "bootimg.c", |
| "cmdline.c", |
| "compression.c", |
| "device_id.c", |
| "diskio.c", |
| "fastboot.c", |
| "framebuffer.c", |
| "inet6.c", |
| "logo.c", |
| "mdns.c", |
| "misc.c", |
| "netboot.c", |
| "netifc.c", |
| "osboot.c", |
| "pci.c", |
| "tcp.c", |
| "utf_conversion.c", |
| "util.c", |
| "zircon.c", |
| ] |
| include_dirs = [ "." ] |
| deps = [ |
| "../lib", |
| "//src/firmware/lib/abr", |
| "//src/firmware/lib/zbi", |
| "//src/firmware/lib/zircon_boot", |
| "//third_party/android/platform/external/avb", |
| "//zircon/kernel/lib/efi", |
| "//zircon/system/public", |
| "//zircon/system/ulib/gfx-font", |
| "//zircon/system/ulib/tftp", |
| "//zircon/third_party/ulib/cksum", |
| "//zircon/third_party/ulib/lz4", |
| ] |
| |
| # TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ |
| ":config", |
| "//build/config:Wno-conversion", |
| ] |
| } |
| |
| # MacOS is missing <endian.h>, so we don't build the tests for it. |
| if (!is_mac) { |
| test("gigaboot_test") { |
| # In order to make it easier to add tests incrementally, just add the source |
| # files we need here rather than depending on :src in full. This allows us to |
| # stub out the UEFI APIs as we need them, rather than all at once. |
| # |
| # Once we have enough functionality stubbed out host-side we can just depend |
| # on ":src" directly instead. |
| sources = [ |
| "abr.c", |
| "acpi.c", |
| "acpi_test.cc", |
| "avb.c", |
| "avb_test.cc", |
| "bootbyte_fake.cc", |
| "cmdline.c", |
| "compression.c", |
| "compression_test.cc", |
| "diskio.c", |
| "diskio_test.cc", |
| "fastboot.c", |
| "fastboot_test.cc", |
| "logo.c", |
| "logo_test.cc", |
| "mdns.c", |
| "mdns_test.cc", |
| "osboot.c", |
| "osboot_test.cc", |
| "pci.c", |
| "tcp.c", |
| "tcp_test.cc", |
| "utf_conversion.c", |
| "util.c", |
| "util_test.cc", |
| ] |
| include_dirs = [ "." ] |
| deps = [ |
| "../host", |
| "//src/firmware/lib/abr", |
| "//src/firmware/lib/zbi", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/android/platform/external/avb", |
| "//third_party/googletest:gmock", |
| "//zircon/kernel/lib/efi", |
| "//zircon/kernel/lib/efi/testing", |
| "//zircon/system/ulib/gfx-font", |
| "//zircon/third_party/ulib/cksum", |
| "//zircon/third_party/ulib/lz4", |
| ] |
| configs += [ ":config" ] |
| } |
| } else { |
| group("gigaboot_test") { |
| } |
| } |