| # 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") |
| |
| source_set("virtio_ethernet_lib") { |
| defines = [ "_ALL_SOURCE" ] |
| sources = [ |
| "ethernet.cc", |
| "ethernet_driver.cc", |
| ] |
| public_deps = [ |
| "//sdk/banjo/ddk.protocol.ethernet", |
| "//src/devices/bus/lib/virtio", |
| "//src/devices/lib/dev-operation", |
| "//src/lib/ddktl", |
| ] |
| } |
| |
| driver_module("virtio_ethernet") { |
| defines = [ "_ALL_SOURCE" ] |
| configs += [ "//build/config/fuchsia:enable_zircon_asserts" ] |
| configs -= [ "//build/config/fuchsia:no_cpp_standard_library" ] |
| configs += [ "//build/config/fuchsia:static_cpp_standard_library" ] |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| deps = [ |
| ":virtio_ethernet_lib", |
| "//src/devices/lib/driver", |
| ] |
| } |
| |
| test("virtio-ethernet-test") { |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| if (is_fuchsia) { |
| testonly = true |
| } |
| sources = [ "ethernet_test.cc" ] |
| deps = [ |
| ":virtio_ethernet_lib", |
| "//src/devices/testing/fake-bti", |
| "//src/devices/testing/fake_ddk", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", |
| ] |
| } |
| |
| unittest_package("virtio-ethernet-test-package") { |
| package_name = "virtio-ethernet-test" |
| deps = [ ":virtio-ethernet-test" ] |
| |
| tests = [ |
| { |
| name = "virtio-ethernet-test" |
| dest = "virtio-ethernet-test" |
| }, |
| ] |
| } |