| # 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/components.gni") |
| import("//build/test.gni") |
| import("//build/zircon/zx_library.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":virtio", |
| ":virtio-backend-test-package", |
| ] |
| } |
| |
| test("virtio-backend-test") { |
| sources = [ "backend_tests.cc" ] |
| deps = [ |
| ":virtio", |
| "//sdk/lib/async_patterns/testing/cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//src/devices/pci/testing:pci-protocol-fake", |
| "//src/devices/testing/fake-bti", |
| "//src/devices/testing/mock-ddk", |
| "//zircon/system/ulib/async-default", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| # TODO(https://fxbug.dev/42136089): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| fuchsia_unittest_package("virtio-backend-test-package") { |
| component_name = "virtio-backend-test" |
| deps = [ ":virtio-backend-test" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| zx_library("virtio") { |
| sdk = "static" |
| sdk_headers = [ |
| "lib/virtio/driver_utils.h", |
| "lib/virtio/device.h", |
| "lib/virtio/ring.h", |
| "lib/virtio/backends/fake.h", |
| "lib/virtio/backends/pci.h", |
| ] |
| |
| configs += [ "//build/config:all_source" ] |
| sources = [ |
| "backends/pci.cc", |
| "backends/pci_legacy.cc", |
| "backends/pci_modern.cc", |
| "device.cc", |
| "driver_utils.cc", |
| "ring.cc", |
| ] |
| public_deps = [ |
| "//sdk/lib/stdcompat", |
| "//src/devices/lib/driver", |
| "//src/devices/lib/mmio", |
| "//src/devices/pci/lib/device-protocol-pci", |
| "//src/lib/ddk", |
| "//src/lib/ddk:ddk-deprecated-mmio-headers", |
| "//src/lib/ddktl", |
| "//src/ui/input/lib/hid", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/hwreg", |
| "//zircon/system/ulib/pretty", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/virtio", |
| "//zircon/system/ulib/zircon-internal", |
| "//zircon/system/ulib/zx", |
| ] |
| |
| # TODO(https://fxbug.dev/42136089): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |