| # 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/config/fuchsia/rules.gni") |
| import("//build/test.gni") |
| import("//build/test/test_package.gni") |
| |
| driver_module("core") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| output_name = "block.core" |
| deps = [ |
| ":shared", |
| "//sdk/lib/syslog/cpp:backend_legacy", |
| "//src/devices/lib/driver", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":core-unittest-package" ] |
| } |
| |
| test("core-unittest") { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| output_name = "blockcore" |
| include_dirs = [ "." ] |
| sources = [ |
| "test/main.cc", |
| "test/server.cc", |
| "test/stub-block-device.cc", |
| ] |
| deps = [ |
| ":shared", |
| "//sdk/banjo/ddk.protocol.block", |
| "//sdk/lib/fdio", |
| "//src/devices/testing/no_ddk", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/fzl", |
| "//zircon/system/ulib/io-scheduler", |
| ] |
| } |
| |
| unittest_package("core-unittest-package") { |
| package_name = "core-unittest" |
| deps = [ ":core-unittest" ] |
| tests = [ |
| { |
| name = "blockcore" |
| }, |
| ] |
| } |
| |
| source_set("shared") { |
| visibility = [ "./*" ] |
| configs += [ "//build/config:all_source" ] |
| sources = [ |
| "block-device.cc", |
| "iobuffer.cc", |
| "manager.cc", |
| "message-group.cc", |
| "message.cc", |
| "server.cc", |
| ] |
| deps = [ |
| "//sdk/banjo/ddk.protocol.block", |
| "//sdk/banjo/ddk.protocol.block.partition", |
| "//sdk/banjo/ddk.protocol.block.volume", |
| "//sdk/fidl/fuchsia.hardware.block:fuchsia.hardware.block_c", |
| "//sdk/fidl/fuchsia.hardware.block.partition:fuchsia.hardware.block.partition_c", |
| "//sdk/fidl/fuchsia.hardware.block.volume:fuchsia.hardware.block.volume_c", |
| "//sdk/lib/syslog/cpp", |
| "//src/devices/lib/dev-operation", |
| "//src/lib/ddk", |
| |
| # TODO(fxb/38132): Migrate to the new bind rules and delete the below |
| "//src/lib/ddk:ddk-deprecated-binding-headers", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/fidl-utils", |
| "//zircon/system/ulib/fzl", |
| "//zircon/system/ulib/storage-metrics", |
| ] |
| } |